bug26802.phpt 556 B

1234567891011121314151617181920212223242526272829303132333435
  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. --EXPECT--
  27. global_func
  28. foo::foo_func