summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/preg_replace_callback_array.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-03-21 16:54:45 +0800
committerXinchen Hui <laruence@php.net>2015-03-21 16:54:45 +0800
commit4180226117f90dd24f15fcdd793deef26c3cdf3c (patch)
tree016d178bfc09a3696899ca17b8456251a39f25f2 /ext/pcre/tests/preg_replace_callback_array.phpt
parentcda8e60638d3d72579f7b28180af481366d380c2 (diff)
downloadphp-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.phpt17
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"