#39257 [NoF->Csd]: preg_replace_callback swallows exceptions
| From: | php at theos dot me dot uk | Date: | Fri, 08 Dec 2006 03:23:01 +0000 |
| Subject: | #39257 [NoF->Csd]: preg_replace_callback swallows exceptions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106081@lists.php.net to get a copy of this message | ||
ID: 39257
User updated by: php at theos dot me dot uk
Reported By: php at theos dot me dot uk
-Status: No Feedback
+Status: Closed
Bug Type: PCRE related
Operating System: Debian Sid
PHP Version: 5.1.6
New Comment:
Works in 5.2
Previous Comments:
------------------------------------------------------------------------
[2006-11-02 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-10-25 18:31:07] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Cannot reproduce.
------------------------------------------------------------------------
[2006-10-25 17:52:27] php at theos dot me dot uk
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=39257&edit=1