--TEST-- Test preg_grep() function : error conditions - bad regular expressions --FILE-- getMessage(), "\n"; } } $value = new stdclass(); //Object try { var_dump(preg_grep($value, $array)); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } echo "Done" ?> --EXPECTF-- *** Testing preg_grep() : error conditions *** Arg value is abcdef Warning: preg_grep(): Delimiter must not be alphanumeric or backslash in %spreg_grep_error1.php on line %d bool(false) Arg value is /[a-zA-Z] Warning: preg_grep(): No ending delimiter '/' found in %spreg_grep_error1.php on line %d bool(false) Arg value is [a-zA-Z]/ Warning: preg_grep(): Unknown modifier '/' in %spreg_grep_error1.php on line %d bool(false) Arg value is /[a-zA-Z]/F Warning: preg_grep(): Unknown modifier 'F' in %spreg_grep_error1.php on line %d bool(false) Arg value is Array preg_grep(): Argument #1 ($pattern) must be of type string, array given Arg value is /[a-zA-Z]/ array(2) { [1]=> string(3) "abc" [2]=> string(4) "test" } preg_grep(): Argument #1 ($pattern) must be of type string, stdClass given Done