bug35821.phpt 659 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Bug #35821 (array_map() segfaults when exception is throwed from the callback)
  3. --FILE--
  4. <?php
  5. class Element
  6. {
  7. public function ThrowException ()
  8. {
  9. throw new Exception();
  10. }
  11. public static function CallBack(Element $elem)
  12. {
  13. $elem->ThrowException();
  14. }
  15. }
  16. $arr = array(new Element(), new Element(), new Element());
  17. array_map(array('Element', 'CallBack'), $arr);
  18. echo "Done\n";
  19. ?>
  20. --EXPECTF--
  21. Fatal error: Uncaught Exception in %s:%d
  22. Stack trace:
  23. #0 %s(%d): Element->ThrowException()
  24. #1 [internal function]: Element::CallBack(Object(Element))
  25. #2 %s(%d): array_map(Array, Array)
  26. #3 {main}
  27. thrown in %s on line %d