3v4l.org

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