3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function testFunc($name) { echo "hello " . $name . ' !!'; } } class B { public function testAnotherFunc(callable $funcName) { $funcName('Percy'); } } $b = new B(); $b->testAnotherFunc(array(static(A), 'testFunc'));
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '(', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/FS7MW on line 25
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '(', expecting T_PAAMAYIM_NEKUDOTAYIM in /in/FS7MW on line 25
Process exited with code 255.

preferences:
179.99 ms | 1399 KiB | 56 Q