diff options
Diffstat (limited to 'ext/standard/tests/array/array_filter_variation9.phpt')
-rw-r--r-- | ext/standard/tests/array/array_filter_variation9.phpt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt index ed89d13d35..1755a322b0 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -22,10 +22,18 @@ var_dump( array_filter($input, 'is_int') ); var_dump( array_filter($input, 'chr') ); // using language construct 'echo' as 'callback' -var_dump( array_filter($input, 'echo') ); +try { + var_dump( array_filter($input, 'echo') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // using language construct 'exit' as 'callback' -var_dump( array_filter($input, 'exit') ); +try { + var_dump( array_filter($input, 'exit') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> @@ -63,10 +71,6 @@ array(8) { [7]=> NULL } - -Warning: array_filter() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL - -Warning: array_filter() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name in %s on line %d -NULL +array_filter() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name +array_filter() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name Done |