has_property_after_dispose.phpt 619 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Test V8::executeString() : has_property after dispose
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. class Foo {
  8. function callMe($x) {
  9. var_dump(property_exists($x, 'bla'));
  10. $this->x = $x;
  11. }
  12. }
  13. $v8 = new V8Js();
  14. $v8->foo = $foo = new Foo();
  15. $JS = <<< EOT
  16. PHP.foo.callMe({ bla: 23 });
  17. EOT;
  18. $v8->executeString($JS, 'basic.js');
  19. unset($v8);
  20. try {
  21. var_dump(property_exists($foo->x, 'bla'));
  22. }
  23. catch(V8JsException $e) {
  24. var_dump($e->getMessage());
  25. }
  26. ?>
  27. ===EOF===
  28. --EXPECTF--
  29. bool(true)
  30. string(55) "Can't access V8Object after V8Js instance is destroyed!"
  31. ===EOF===