#40618 [Opn->Bgs]: Exception in callback methoid leads to fatal Error
| From: | tony2001@php.net | Date: | Mon, 26 Feb 2007 08:06:47 +0000 |
| Subject: | #40618 [Opn->Bgs]: Exception in callback methoid leads to fatal Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109519@lists.php.net to get a copy of this message | ||
ID: 40618
Updated by: tony2001@php.net
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