bug26802.phpt 560 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #26802 (Can't call static method using a variable)
  3. --FILE--
  4. <?php
  5. function global_func()
  6. {
  7. echo __METHOD__ . "\n";
  8. }
  9. $function = 'global_func';
  10. $function();
  11. class foo
  12. {
  13. static $method = 'global_func';
  14. static public function foo_func()
  15. {
  16. echo __METHOD__ . "\n";
  17. }
  18. }
  19. /* The following is a BC break with PHP 4 where it would
  20. * call foo::fail. In PHP 5 we first evaluate static class
  21. * properties and then do the function call.
  22. */
  23. $method = 'foo_func';
  24. foo::$method();
  25. ?>
  26. ===DONE===
  27. --EXPECT--
  28. global_func
  29. foo::foo_func
  30. ===DONE===