3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { function __invoke() { echo 'invoke'; } } $callable = new test(); if (is_callable($callable)) { echo 'is callable!'; } else { echo 'not callable'; } $callable();
based on lVVsC
Output for 5.3.0 - 7.2.0
is callable!invoke
Output for 5.0.0 - 5.2.17
not callable Fatal error: Function name must be a string in /in/Ft1Jn on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9
not callable Notice: Object to string conversion in /in/Ft1Jn on line 13 Fatal error: Call to undefined function: object() in /in/Ft1Jn on line 13
Process exited with code 255.
Output for 4.3.2 - 4.4.4
not callable Notice: Object to string conversion in /in/Ft1Jn on line 13 Fatal error: Call to undefined function: object() in /in/Ft1Jn on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
not callable Notice: Object to string conversion in /in/Ft1Jn on line 13 Fatal error: Call to undefined function: object() in /in/Ft1Jn on line 13