bug69124.phpt 354 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug 69124: Method name must be as string (invalid error message when using reference to a string)
  3. --FILE--
  4. <?php
  5. class Foo {
  6. public function bar() {
  7. print "Success\n";
  8. }
  9. }
  10. function test(&$instance, &$method) {
  11. $instance->{$method}();
  12. }
  13. $instance = new Foo;
  14. $method = "bar";
  15. test($instance, $method);
  16. ?>
  17. --EXPECT--
  18. Success