diff options
Diffstat (limited to 'ext/standard/tests/array/array_map_001.phpt')
-rw-r--r-- | ext/standard/tests/array/array_map_001.phpt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/standard/tests/array/array_map_001.phpt b/ext/standard/tests/array/array_map_001.phpt new file mode 100644 index 000000000..646eb7695 --- /dev/null +++ b/ext/standard/tests/array/array_map_001.phpt @@ -0,0 +1,23 @@ +--TEST-- +array_map() and exceptions in the callback +--FILE-- +<?php + +$a = array(1,2,3); + +function foo() { + throw new exception(1); +} + +try { + array_map("foo", $a, array(2,3)); +} catch (Exception $e) { + var_dump("exception caught!"); +} + +echo "Done\n"; +?> +--EXPECTF-- +Warning: array_map(): An error occurred while invoking the map callback in %s on line %d +string(17) "exception caught!" +Done |