ID:               40618
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ludwig at gramberg-webdesign dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         PCRE related
 Operating System: Windows 2000
 PHP Version:      5.2.1
 New Comment:

Warning: preg_replace_callback(): Unable to call custom replacement
function in /tmp/4.php on line 14
Yay, exception! <---------


Previous Comments:
------------------------------------------------------------------------

[2007-02-24 14:17:57] ludwig at gramberg-webdesign dot de

Description:
------------
If a function called by preg_replace_callback throws an 
exception this exception is not propagated up to the 
function which called preg_replace_callback. Instead a PHP 
error is produced. This error contains no information about 
what the problem was or where it occurred.

Reproduce code:
---------------
<?php

function thrower() {
  throw new Exception("Hello");
}

try {
  $b = preg_replace_callback('/./', 'thrower', 'a');
} catch ( Exception $e ) {
  echo 'Yay, exception!';
}

?>

Expected result:
----------------
code to output

Yay, exception!

Actual result:
--------------
Warning: preg_replace_callback(): Unable to call custom 
replacement function on line 13


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40618&edit=1

Reply via email to