objects_027.phpt 365 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Testing 'new static;' calling parent method
  3. --FILE--
  4. <?php
  5. class bar {
  6. public function show() {
  7. var_dump(new static);
  8. }
  9. }
  10. class foo extends bar {
  11. public function test() {
  12. parent::show();
  13. }
  14. }
  15. $foo = new foo;
  16. $foo->test();
  17. call_user_func(array($foo, 'test'));
  18. ?>
  19. --EXPECTF--
  20. object(foo)#%d (0) {
  21. }
  22. object(foo)#%d (0) {
  23. }