3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $serialized_array = serialize(array(1234=>array("something"=>"foobar"))); echo "Serialized Array: $serialized_array" . PHP_EOL; $array = unserialize($serialized_array); print_r($array); $key = 1234 if (array_key_exists($key, $array)) { echo "Key Exists!"; } else { echo "Key Not Found!"; }
based on 9Fo4u
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'if' (T_IF) in /in/EB1PQ on line 9
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_IF in /in/EB1PQ:9 Stack trace: #0 {main}
Process exited with code 255.