test_extend.php 456 B

1234567891011121314151617181920212223
  1. <?php
  2. // Test class
  3. class Testing extends V8Js
  4. {
  5. public $foo = 'ORIGINAL';
  6. private $my_private = 'arf'; // Should not show in JS side
  7. protected $my_protected = 'argh'; // Should not show in JS side
  8. public function mytest($a, $b, $c = NULL)
  9. {
  10. var_dump(func_get_args());
  11. }
  12. }
  13. $a = new Testing();
  14. echo $a;
  15. try {
  16. $a->executeString("PHP.mytest(PHP.foo, PHP.my_private, PHP.my_protected);", "test7.js");
  17. } catch (V8JsException $e) {
  18. var_dump($e);
  19. }