diff options
Diffstat (limited to 'ext/pcre/tests/bug21732.phpt')
-rw-r--r-- | ext/pcre/tests/bug21732.phpt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/pcre/tests/bug21732.phpt b/ext/pcre/tests/bug21732.phpt index 3dfc41e19f..629e015a06 100644 --- a/ext/pcre/tests/bug21732.phpt +++ b/ext/pcre/tests/bug21732.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #21732 (preg_replace() segfaults with invalid parameters) ---INI-- -error_reporting=0 --FILE-- <?php class foo { @@ -11,11 +9,15 @@ class foo { } } -var_dump(preg_replace('', array(), '')); +try { + var_dump(preg_replace('', array(), '')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde')); ?> --EXPECT-- -bool(false) +Parameter mismatch, pattern is a string while replacement is an array array(4) { [0]=> string(5) "abcde" |