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

>This bug exists under 5.2.1/win.
What kind of bug? The exception is thrown and successfully caught.
I agree that the warning is not needed in this case, I'll discuss it
with the extension maintainer.

>Just get the latest XAMPP, install it under win and run the code
Please provide a short but complete reproduce code.


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

[2007-02-26 09:17:06] ludwig at gramberg-webdesign dot de

This bug exists under 5.2.1/win. I saw it here first as a bug under
5.2.1/debian and there it said the bug would is gone in 5.2.1 but under
win it's definetly not.

Just get the latest XAMPP, install it under win and run the code. The
line 13/14 is just because i copied the code from the other bug report
since it's the same.

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

[2007-02-26 08:06:47] [EMAIL PROTECTED]

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

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

[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