]> granicus.if.org Git - php/commitdiff
MFH: remove unnecessary warning in case of exception
authorAntony Dovgal <tony2001@php.net>
Wed, 14 Mar 2007 23:47:44 +0000 (23:47 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 14 Mar 2007 23:47:44 +0000 (23:47 +0000)
ext/pcre/php_pcre.c
ext/pcre/tests/preg_replace_callback2.phpt

index bd1383b43ae8261bd2f1743d8643649d2200db32..c11fd4fda0a526b41a8d458f820430de32c500c2 100644 (file)
@@ -811,7 +811,9 @@ static int preg_do_repl_func(zval *function, char *subject, int *offsets, int co
                result_len = Z_STRLEN_P(retval_ptr);
                zval_ptr_dtor(&retval_ptr);
        } else {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+               if (!EG(exception)) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+               }
                result_len = offsets[1] - offsets[0];
                *result = estrndup(&subject[offsets[0]], result_len);
        }
index a7f5a362dcbd34aeb8c31bb9dcc328be76bf455e..7989509aa1eecf1b1a8758427d060eb61e8a40b3 100644 (file)
@@ -22,7 +22,6 @@ var_dump(preg_replace_callback('~\A.~', 'g', array(array('xyz'))));
 var_dump(preg_replace_callback('~\A.~', create_function('$m', 'return strtolower($m[0]);'), 'ABC'));
 ?>
 --EXPECTF--
-Warning: preg_replace_callback(): Unable to call custom replacement function in %spreg_replace_callback2.php on line %d
 array(3) {
   [0]=>
   string(12) "'a' 'b3' bcd"