bug71622.phpt 528 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #71622 (Strings used in pass-as-reference cannot be used to invoke C::$callable())
  3. --FILE--
  4. <?php
  5. function getMethodName(&$methodName) {
  6. $methodName = Abc::METHOD_NAME;
  7. }
  8. class Abc {
  9. const METHOD_NAME = "goal";
  10. private static function goal() {
  11. echo "success\n";
  12. }
  13. public static function run() {
  14. $method = "foobar";
  15. getMethodName($method);
  16. var_dump(is_callable("self::$method"));
  17. self::$method();
  18. }
  19. }
  20. Abc::run();
  21. ?>
  22. --EXPECT--
  23. bool(true)
  24. success