bug30266.phpt 530 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #30266 (Invalid opcode 137/1/8) and array_walk
  3. --FILE--
  4. <?php
  5. class testc
  6. {
  7. public $b = "c";
  8. function crash($val)
  9. {
  10. $this->b = $val;
  11. throw new Exception("Error");
  12. }
  13. }
  14. $fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
  15. $myobj = new testc();
  16. function test($item2, $key, $userd)
  17. {
  18. $userd->crash($item2);
  19. }
  20. try
  21. {
  22. array_walk($fruits, 'test', $myobj);
  23. }
  24. catch(Exception $e)
  25. {
  26. echo "Caught: " . $e->getMessage() . "\n";
  27. }
  28. ?>
  29. --EXPECT--
  30. Caught: Error