3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arg = 'T'; $vehicle = ( ( $arg == 'B' ) ? 'bus' : ( $arg == 'A' ) ? 'airplane' : ( $arg == 'I' ) ? 'train' : ( $arg == 'C' ) ? 'car' : ( $arg == 'I' ) ? 'horse' : 'feet' ); echo $vehicle; $vehicle2 = array( "B" => "bus", "A" => "airplane", "T" => "train", "C" => "car", "H" => "hourse", "default" => "feet" ); echo $vehicle2($arg);
Output for 7.0.0 - 7.1.0
feet Fatal error: Uncaught Error: Function name must be a string in /in/cRV3t:18 Stack trace: #0 {main} thrown in /in/cRV3t on line 18
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
feet Fatal error: Uncaught Error: Invalid callable (array) in /in/cRV3t:18 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
feet Fatal error: Invalid callable (array) in /in/cRV3t on line 18
Process exited with code 255.
Output for 5.0.0 - 5.6.28
feet Fatal error: Function name must be a string in /in/cRV3t on line 18
Process exited with code 255.
Output for 4.4.5 - 4.4.9
feet Notice: Array to string conversion in /in/cRV3t on line 18 Fatal error: Call to undefined function: array() in /in/cRV3t on line 18
Process exited with code 255.
Output for 4.3.2 - 4.4.4
feet Notice: Array to string conversion in /in/cRV3t on line 18 Fatal error: Call to undefined function: array() in /in/cRV3t on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1
feet Notice: Array to string conversion in /in/cRV3t on line 18 Fatal error: Call to undefined function: array() in /in/cRV3t on line 18