3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public function test() { call_user_function([$this, 'test2']); } private function test2() { echo 'Yay'; } } $test = new Test(); $test->test();
Output for 7.0.0 - 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/t3MJN on line 3 Fatal error: Uncaught Error: Call to undefined function call_user_function() in /in/t3MJN:7 Stack trace: #0 /in/t3MJN(16): Test->test() #1 {main} thrown in /in/t3MJN on line 7
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Call to undefined function call_user_function() in /in/t3MJN on line 7
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/t3MJN on line 7
Process exited with code 255.