3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = []; $s = microtime(true); for ($i = 0; $i < 1000000; $i++) $name = isset($input['name']) ? $input['name']:'John'; var_dump(microtime(true)-$s); $s = microtime(true); for ($i = 0; $i < 1000000; $i++) $name = $input['name'] ?? 'John'; var_dump(microtime(true)-$s);
based on F8I2T
Output for 7.1.0
float(0.031286954879761) float(-0.0020210742950439)
Output for 7.0.14
float(0.029905080795288) float(0.032406806945801)
Output for 7.0.6
float(0.027011156082153) float(0.028555154800415)
Output for 7.0.5
float(0.025668859481812) float(0.027578830718994)
Output for 7.0.4
float(0.02492618560791) float(0.027663946151733)
Output for 7.0.3
float(0.022193908691406) float(0.026746988296509)
Output for 7.0.2
float(0.021767854690552) float(0.026638031005859)
Output for 7.0.1
float(0.016797065734863) float(0.020785093307495)
Output for 7.0.0
float(0.024672985076904) float(0.026760101318359)
Output for hhvm-3.12.0
float(0.066061973571777) float(0.076397895812988)
Output for hhvm-3.10.0
Fatal error: syntax error, unexpected '?' in /in/rUqnO on line 15
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/rUqnO on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/rUqnO on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/rUqnO on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/rUqnO on line 3
Process exited with code 255.