fatal_error_v8function.phpt 741 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test V8Function() : Handle fatal errors gracefully
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. class Foo {
  8. function callback() {
  9. echo "goodbye cruel world!\n";
  10. $this->bar(); // trigger fatal error
  11. }
  12. }
  13. $sandbox = new V8Js();
  14. $sandbox->foo = new Foo();
  15. $cb = $sandbox->executeString('(function() { PHP.foo.callback(); });');
  16. $cb();
  17. ?>
  18. ===EOF===
  19. --EXPECTF--
  20. goodbye cruel world!
  21. Fatal error: Uncaught Error: Call to undefined method Foo::bar() in %s%efatal_error_v8function.php:6
  22. Stack trace:
  23. #0 [internal function]: Foo->callback()
  24. #1 %s%efatal_error_v8function.php(14): V8Function->V8Js::V8::Invoke()
  25. #2 {main}
  26. thrown in %s%efatal_error_v8function.php on line 6