3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $times = 10000; $var = null; $var = new stdClass(); $time1 = microtime(true); for ($i = 0; $i <= $times; $i++) { if (!$var) {} } $time1 = microtime(true) - $time1; //echo "Time using '!': $time1\n"; $time2 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var === null) {} } $time2 = microtime(true) - $time2; //echo "Time using '===': $time2\n"; if ($time1 > $time2){ $p = ($time1-$time2)/$time2; printf("'===' was faster by %.2f percent.", $p); } else { $p = ($time2-$time1)/$time1; printf("'!' was faster by %.2f percent.", $p); }
Output for 5.4.8, 5.4.25, 5.4.39 - 5.4.40, 5.5.15, 5.5.19, 5.5.31, 7.0.0, 7.1.0
'===' was faster by 0.67 percent.
Output for 5.3.14, 5.3.18, 5.3.20, 5.4.28, 7.0.14
'===' was faster by 0.54 percent.
Output for 5.4.10, 5.5.3, 7.0.10
'===' was faster by 0.69 percent.
Output for 5.3.21, 5.4.21, 5.5.13, 5.6.4, 5.6.28, 7.0.9
'===' was faster by 0.76 percent.
Output for 5.5.16, 5.6.19, 7.0.8
'===' was faster by 0.77 percent.
Output for 5.4.7, 5.4.37, 7.0.7
'===' was faster by 0.74 percent.
Output for 5.5.11, 7.0.2, 7.0.6
'===' was faster by 0.81 percent.
Output for 5.6.14, 7.0.5
'===' was faster by 0.23 percent.
Output for 5.4.13, 5.4.42, 7.0.1, 7.0.4
'===' was faster by 0.63 percent.
Output for 5.3.5, 5.4.12, 7.0.3
'===' was faster by 0.58 percent.
Output for 5.2.13, hhvm-3.12.0
'===' was faster by 0.22 percent.
Output for 5.1.6, hhvm-3.10.0
'===' was faster by 0.11 percent.
Output for 5.5.10, 5.5.18, 5.5.36 - 5.5.37, 5.6.1 - 5.6.2, 5.6.7, 5.6.17, 5.6.25
'===' was faster by 0.73 percent.
Output for 5.4.6, 5.4.11, 5.5.9, 5.5.29, 5.5.32, 5.6.23 - 5.6.24
'===' was faster by 0.68 percent.
Output for 5.4.20, 5.4.45, 5.5.1, 5.5.8, 5.5.23, 5.5.38, 5.6.22
'===' was faster by 0.75 percent.
Output for 5.4.18, 5.4.23, 5.5.6, 5.5.12, 5.5.14, 5.5.33, 5.6.6, 5.6.12, 5.6.21
'===' was faster by 0.72 percent.
Output for 5.5.2, 5.5.4, 5.5.21, 5.5.25 - 5.5.26, 5.6.0, 5.6.11, 5.6.13, 5.6.18, 5.6.20
'===' was faster by 0.71 percent.
Output for 5.5.7, 5.5.34, 5.6.16
'===' was faster by 0.84 percent.
Output for 5.4.24, 5.5.27, 5.6.9, 5.6.15
'===' was faster by 0.70 percent.
Output for 5.3.17, 5.4.14, 5.5.0, 5.6.10
'===' was faster by 0.51 percent.
Output for 5.4.3, 5.6.3, 5.6.5, 5.6.8
'===' was faster by 0.80 percent.
Output for 5.5.35
'===' was faster by 0.91 percent.
Output for 5.5.30
'===' was faster by 1.48 percent.
Output for 5.5.24, 5.5.28
'===' was faster by 0.79 percent.
Output for 5.5.22
'===' was faster by 0.86 percent.
Output for 5.1.3, 5.4.2, 5.4.16, 5.4.31 - 5.4.32, 5.4.36, 5.5.20
'===' was faster by 0.66 percent.
Output for 5.4.26, 5.4.34, 5.5.5
'===' was faster by 0.64 percent.
Output for 5.4.44
'===' was faster by 0.43 percent.
Output for 5.2.11, 5.3.6 - 5.3.7, 5.4.43
'===' was faster by 0.57 percent.
Output for 5.4.41
'===' was faster by 0.62 percent.
Output for 5.4.38
'===' was faster by 0.78 percent.
Output for 5.4.0 - 5.4.1, 5.4.4 - 5.4.5, 5.4.17, 5.4.22, 5.4.30, 5.4.35
'===' was faster by 0.65 percent.
Output for 5.4.29
'===' was faster by 1.72 percent.
Output for 5.4.27
'===' was faster by 0.96 percent.
Output for 5.4.19
'===' was faster by 2.05 percent.
Output for 5.2.1, 5.3.12, 5.3.27, 5.4.15
'===' was faster by 0.50 percent.
Output for 5.4.9
'===' was faster by 0.94 percent.
Output for 5.3.1, 5.3.22, 5.3.24, 5.3.29
'===' was faster by 0.53 percent.
Output for 5.3.28
'===' was faster by 0.61 percent.
Output for 5.3.11, 5.3.26
'===' was faster by 0.55 percent.
Output for 5.3.25
'===' was faster by 0.83 percent.
Output for 5.3.0, 5.3.16, 5.3.23
'===' was faster by 0.38 percent.
Output for 5.3.19
'===' was faster by 1.52 percent.
Output for 5.3.15
'===' was faster by 0.56 percent.
Output for 5.3.13
'===' was faster by 0.46 percent.
Output for 5.3.10
'===' was faster by 0.47 percent.
Output for 5.2.3, 5.3.9
'===' was faster by 0.37 percent.
Output for 5.3.8
'===' was faster by 0.60 percent.
Output for 5.3.4
'===' was faster by 0.52 percent.
Output for 5.3.3
'===' was faster by 0.42 percent.
Output for 5.1.5, 5.3.2
'===' was faster by 0.48 percent.
Output for 5.2.8, 5.2.17
'===' was faster by 0.36 percent.
Output for 5.2.9, 5.2.16
'===' was faster by 0.33 percent.
Output for 5.2.15
'===' was faster by 0.25 percent.
Output for 5.2.14
'===' was faster by 0.34 percent.
Output for 5.2.4, 5.2.12
'===' was faster by 0.39 percent.
Output for 5.2.2, 5.2.10
'===' was faster by 0.31 percent.
Output for 5.2.7
'===' was faster by 0.40 percent.
Output for 5.2.6
'===' was faster by 0.30 percent.
Output for 5.2.5
'===' was faster by 0.35 percent.
Output for 5.2.0
'===' was faster by 0.32 percent.
Output for 5.1.4
'===' was faster by 0.26 percent.
Output for 4.3.10, 4.4.2, 5.0.1, 5.1.2
'!' was faster by 0.06 percent.
Output for 5.0.2, 5.1.1
'===' was faster by 0.00 percent.
Output for 4.3.6, 4.4.3, 4.4.6, 5.0.0, 5.1.0
'!' was faster by 0.05 percent.
Output for 5.0.5
'===' was faster by 0.20 percent.
Output for 4.3.0, 4.3.2, 4.3.8, 4.4.4, 5.0.3 - 5.0.4
'!' was faster by 0.07 percent.
Output for 4.4.9
'!' was faster by 0.03 percent.
Output for 4.3.1, 4.3.4, 4.3.11, 4.4.5, 4.4.7 - 4.4.8
'!' was faster by 0.08 percent.
Output for 4.4.1
'!' was faster by 0.27 percent.
Output for 4.3.9, 4.4.0
'!' was faster by 0.09 percent.
Output for 4.3.7
'!' was faster by 0.37 percent.
Output for 4.3.5
'!' was faster by 0.17 percent.
Output for 4.3.3
'!' was faster by 0.10 percent.