has_property_after_dispose.phpt 645 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #[AllowDynamicProperties]
  8. class Foo {
  9. function callMe($x) {
  10. var_dump(property_exists($x, 'bla'));
  11. $this->x = $x;
  12. }
  13. }
  14. $v8 = new V8Js();
  15. $v8->foo = $foo = new Foo();
  16. $JS = <<< EOT
  17. PHP.foo.callMe({ bla: 23 });
  18. EOT;
  19. $v8->executeString($JS, 'basic.js');
  20. unset($v8);
  21. try {
  22. var_dump(property_exists($foo->x, 'bla'));
  23. }
  24. catch(V8JsException $e) {
  25. var_dump($e->getMessage());
  26. }
  27. ?>
  28. ===EOF===
  29. --EXPECTF--
  30. bool(true)
  31. string(55) "Can't access V8Object after V8Js instance is destroyed!"
  32. ===EOF===