array_map_001.phpt 395 B

1234567891011121314151617181920212223
  1. --TEST--
  2. array_map() and exceptions in the callback
  3. --FILE--
  4. <?php
  5. $a = array(1,2,3);
  6. function foo() {
  7. throw new exception(1);
  8. }
  9. try {
  10. array_map("foo", $a, array(2,3));
  11. } catch (Exception $e) {
  12. var_dump("exception caught!");
  13. }
  14. echo "Done\n";
  15. ?>
  16. --EXPECTF--
  17. Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
  18. string(17) "exception caught!"
  19. Done