diff options
Diffstat (limited to 'ext/pcre/tests/preg_match_all_error2.phpt')
-rw-r--r-- | ext/pcre/tests/preg_match_all_error2.phpt | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ext/pcre/tests/preg_match_all_error2.phpt b/ext/pcre/tests/preg_match_all_error2.phpt index 1c55cce64e..8c52b73076 100644 --- a/ext/pcre/tests/preg_match_all_error2.phpt +++ b/ext/pcre/tests/preg_match_all_error2.phpt @@ -12,13 +12,14 @@ error_reporting(E_ALL&~E_NOTICE); */ echo "*** Testing preg_match_all() : error conditions ***\n"; $regex = '/[a-zA-Z]/'; -$value = new stdclass(); //Object -var_dump(preg_match_all($regex, $value, $matches)); -var_dump($matches); $input = array(array('this is', 'a subarray'), 'test',); foreach($input as $value) { print "\nArg value is: $value\n"; - var_dump(preg_match_all($regex, $value, $matches)); + try { + var_dump(preg_match_all($regex, $value, $matches)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } var_dump($matches); } echo "Done"; @@ -26,14 +27,8 @@ echo "Done"; --EXPECTF-- *** Testing preg_match_all() : error conditions *** -Warning: preg_match_all() expects parameter 2 to be string, object given in %spreg_match_all_error2.php on line %d -bool(false) -NULL - Arg value is: Array - -Warning: preg_match_all() expects parameter 2 to be string, array given in %spreg_match_all_error2.php on line %d -bool(false) +preg_match_all() expects parameter 2 to be string, array given NULL Arg value is: test |