3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function wtf(array $arrayUnderTest) { echo is_callable($test) ? 'This is a callable' : 'This is not a callable'; echo "\n"; echo is_array($test) ? 'This is an array' : 'This is not an array'; $test(); } class x { function foo() { print "\nfoo"; } } $x = new x(); $test = array($x, "foo"); wtf($test);
based on 2pcWd
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: test in /in/giKvE on line 4 This is not a callable Notice: Undefined variable: test in /in/giKvE on line 6 This is not an array Notice: Undefined variable: test in /in/giKvE on line 7 Fatal error: Uncaught Error: Function name must be a string in /in/giKvE:7 Stack trace: #0 /in/giKvE(19): wtf(Array) #1 {main} thrown in /in/giKvE on line 7
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Notice: Undefined variable: test in /in/giKvE on line 4 This is not a callable Notice: Undefined variable: test in /in/giKvE on line 6 This is not an array Notice: Undefined variable: test in /in/giKvE on line 7 Fatal error: Function name must be a string in /in/giKvE on line 7
Process exited with code 255.