diff options
author | Xinchen Hui <laruence@php.net> | 2015-03-21 16:54:45 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-03-21 16:54:45 +0800 |
commit | 4180226117f90dd24f15fcdd793deef26c3cdf3c (patch) | |
tree | 016d178bfc09a3696899ca17b8456251a39f25f2 /ext/pcre/tests/preg_replace_callback_array.phpt | |
parent | cda8e60638d3d72579f7b28180af481366d380c2 (diff) | |
download | php-git-4180226117f90dd24f15fcdd793deef26c3cdf3c.tar.gz |
More error conditions
Diffstat (limited to 'ext/pcre/tests/preg_replace_callback_array.phpt')
-rw-r--r-- | ext/pcre/tests/preg_replace_callback_array.phpt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/pcre/tests/preg_replace_callback_array.phpt b/ext/pcre/tests/preg_replace_callback_array.phpt index 529f704db6..14a4656eb1 100644 --- a/ext/pcre/tests/preg_replace_callback_array.phpt +++ b/ext/pcre/tests/preg_replace_callback_array.phpt @@ -4,12 +4,19 @@ preg_replace_callback_array() basic functions <?php function f() { - throw new Exception(); + throw new Exception('f'); +} + +function a() { + return __FUNCTION__; } try { -var_dump(preg_replace_callback_array(array('/\w/' => 'f'), 'z')); -} catch(Exception $e) {} + var_dump($c = preg_replace_callback_array(array('/\w*/' => 'f', '/\w/' => 'a'), 'z')); +} catch(Exception $e) { + var_dump($e->getMessage()); +} +var_dump($c); function g($x) { return "'$x[0]'"; @@ -22,6 +29,10 @@ var_dump(preg_replace_callback_array(array('~\A.~' => 'g'), array(array('xyz'))) var_dump(preg_replace_callback_array(array('~\A.~' => create_function('$m', 'return strtolower($m[0]);')), 'ABC')); ?> --EXPECTF-- +string(1) "f" + +Notice: Undefined variable: c in %spreg_replace_callback_array.php on line %d +NULL array(3) { [0]=> string(12) "'a' 'b3' bcd" |