issue_497_001.phpt 692 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Test V8::executeString() : Issue #497 (segmentation fault calling PHP exit inside object function)
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. class Foo {
  8. function __destruct() {
  9. var_dump('Foo __destruct');
  10. }
  11. function somecall() {
  12. var_dump('Foo somecall');
  13. }
  14. function bar() {
  15. global $v8;
  16. var_dump('Foo bar');
  17. exit;
  18. }
  19. }
  20. $v8 = new \V8Js();
  21. $v8->foo = new Foo();
  22. $JS = <<< EOT
  23. PHP.foo.somecall();
  24. PHP.foo.bar();
  25. EOT;
  26. $v8->executeString($JS, '', \V8JS::FLAG_PROPAGATE_PHP_EXCEPTIONS);
  27. echo 'Not here!!';
  28. ?>
  29. --EXPECTF--
  30. string(12) "Foo somecall"
  31. string(7) "Foo bar"
  32. string(14) "Foo __destruct"