3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var = null; $var = new stdClass(); $time1 = microtime(true); for ($i = 0; $i <= 1000000; $i++) { if (!$var) {} } $time1 = microtime(true) - $time1; echo "Time using '!': $time\n"; $time2 = microtime(true); for ($i = 0; $i <= 1000000; $i++) { if ($var === null) {} } $time2 = microtime(true) - $time2; echo "Time using '===': $time\n"; if ($time1 > $time2) echo '"===" was faster'; else echo '"!" was faster';
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: time in /in/QGlnm on line 14 Time using '!': Notice: Undefined variable: time in /in/QGlnm on line 25 Time using '===': "===" was faster
Output for 4.3.0 - 4.3.4, 4.3.6 - 4.3.7, 4.3.9, 4.4.1 - 4.4.2, 4.4.4, 4.4.6 - 4.4.9, 5.0.1 - 5.0.3
Notice: Undefined variable: time in /in/QGlnm on line 14 Time using '!': Notice: Undefined variable: time in /in/QGlnm on line 25 Time using '===': "===" was faster
Output for 4.3.5, 4.3.8, 4.3.10 - 4.4.0, 4.4.3, 4.4.5, 5.0.0
Notice: Undefined variable: time in /in/QGlnm on line 14 Time using '!': Notice: Undefined variable: time in /in/QGlnm on line 25 Time using '===': "!" was faster