3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __invoke() { return 1; } } $foo = new Foo; echo call_user_func($foo);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
1
Output for 5.2.0 - 5.2.17
Catchable fatal error: Object of class Foo could not be converted to string in /in/vrPtg on line 9
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Notice: Object of class Foo to string conversion in /in/vrPtg on line 9 Warning: call_user_func(Object): First argument is expected to be a valid callback in /in/vrPtg on line 9
Output for 4.3.2 - 4.4.9
Notice: Object to string conversion in /in/vrPtg on line 9 Warning: call_user_func(Object): First argument is expected to be a valid callback in /in/vrPtg on line 9
Output for 4.3.0 - 4.3.1
Notice: Object to string conversion in /in/vrPtg on line 9 Warning: call_user_func(Object) [http://www.php.net/function.call-user-func]: First argument is expected to be a valid callback in /in/vrPtg on line 9