objects_027.phpt 808 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. $foo::test();
  18. call_user_func(array($foo, 'test'));
  19. call_user_func(array('foo', 'test'));
  20. ?>
  21. --EXPECTF--
  22. object(foo)#%d (0) {
  23. }
  24. Deprecated: Non-static method foo::test() should not be called statically in %s on line %d
  25. Deprecated: Non-static method bar::show() should not be called statically in %s on line %d
  26. object(foo)#%d (0) {
  27. }
  28. object(foo)#%d (0) {
  29. }
  30. Deprecated: %son-static method foo::test() should not be called statically in %s on line %d
  31. Deprecated: Non-static method bar::show() should not be called statically in %s on line %d
  32. object(foo)#%d (0) {
  33. }