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 instanceof stdClass) {} } $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) * 100; printf("'!== null' was faster by %.2f percent.", $p); } else { $p = (($time2-$time1)/$time1) * 100; printf("'instanceof' was faster by %.2f percent.", $p); }
Output for 7.1.0
'!== null' was faster by 32.92 percent.
Output for 7.0.14
'!== null' was faster by 25.95 percent.
Output for 7.0.12
'!== null' was faster by 27.21 percent.
Output for 7.0.6
'!== null' was faster by 27.59 percent.
Output for 7.0.5
'!== null' was faster by 31.63 percent.
Output for 7.0.4
'!== null' was faster by 30.66 percent.
Output for 7.0.3
'!== null' was faster by 30.81 percent.
Output for 7.0.2
'!== null' was faster by 13.54 percent.
Output for 7.0.1
'!== null' was faster by 31.29 percent.
Output for 7.0.0
'!== null' was faster by 26.46 percent.
Output for hhvm-3.12.0
'!== null' was faster by 29.67 percent.
Output for hhvm-3.10.0
'!== null' was faster by 35.79 percent.
Output for 5.6.28
'!== null' was faster by 72.10 percent.
Output for 5.6.21
'!== null' was faster by 24.89 percent.
Output for 5.6.20
'!== null' was faster by 24.32 percent.
Output for 5.6.19
'!== null' was faster by 27.93 percent.
Output for 5.6.18
'!== null' was faster by 21.77 percent.
Output for 5.6.17
'!== null' was faster by 22.48 percent.
Output for 5.6.16
'!== null' was faster by 24.57 percent.
Output for 5.6.15
'!== null' was faster by 23.42 percent.
Output for 5.6.14
'!== null' was faster by 14.58 percent.
Output for 5.6.13
'!== null' was faster by 13.09 percent.
Output for 5.6.12
'!== null' was faster by 26.02 percent.
Output for 5.6.11
'!== null' was faster by 16.69 percent.
Output for 5.6.10
'!== null' was faster by 15.02 percent.
Output for 5.4.8, 5.6.9
'!== null' was faster by 23.05 percent.
Output for 5.6.8
'!== null' was faster by 18.24 percent.
Output for 5.6.7
'!== null' was faster by 22.21 percent.
Output for 5.5.35
'!== null' was faster by 28.05 percent.
Output for 5.5.34
'!== null' was faster by 22.78 percent.
Output for 5.5.33
'!== null' was faster by 19.71 percent.
Output for 5.5.32
'!== null' was faster by 25.41 percent.
Output for 5.5.31
'!== null' was faster by 22.16 percent.
Output for 5.5.30
'!== null' was faster by 19.72 percent.
Output for 5.5.29
'!== null' was faster by 27.90 percent.
Output for 5.5.28
'!== null' was faster by 25.08 percent.
Output for 5.5.27
'!== null' was faster by 25.39 percent.
Output for 5.5.26
'!== null' was faster by 24.92 percent.
Output for 5.5.25
'!== null' was faster by 21.52 percent.
Output for 5.5.24
'!== null' was faster by 19.15 percent.
Output for 5.4.45
'!== null' was faster by 15.78 percent.
Output for 5.4.44
'!== null' was faster by 23.40 percent.
Output for 5.4.43
'!== null' was faster by 23.35 percent.
Output for 5.4.42
'!== null' was faster by 23.27 percent.
Output for 5.4.41
'!== null' was faster by 24.23 percent.
Output for 5.4.40
'!== null' was faster by 6.94 percent.
Output for 5.4.39
'!== null' was faster by 23.54 percent.
Output for 5.4.38
'!== null' was faster by 9.62 percent.
Output for 5.4.37
'!== null' was faster by 24.10 percent.
Output for 5.4.36
'!== null' was faster by 24.22 percent.
Output for 5.4.35
'!== null' was faster by 22.66 percent.
Output for 5.4.34
'!== null' was faster by 22.93 percent.
Output for 5.4.32
'!== null' was faster by 26.62 percent.
Output for 5.4.25, 5.4.31
'!== null' was faster by 22.71 percent.
Output for 5.4.30
'!== null' was faster by 24.15 percent.
Output for 5.4.29
'!== null' was faster by 3.79 percent.
Output for 5.4.28
'!== null' was faster by 28.32 percent.
Output for 5.4.27
'!== null' was faster by 30.73 percent.
Output for 5.4.26
'!== null' was faster by 28.26 percent.
Output for 5.4.24
'!== null' was faster by 23.61 percent.
Output for 5.4.23
'!== null' was faster by 34.59 percent.
Output for 5.4.22
'!== null' was faster by 21.60 percent.
Output for 5.4.21
'!== null' was faster by 35.26 percent.
Output for 5.4.20
'!== null' was faster by 21.54 percent.
Output for 5.4.19
'!== null' was faster by 23.47 percent.
Output for 5.4.18
'!== null' was faster by 21.95 percent.
Output for 5.4.17
'!== null' was faster by 25.74 percent.
Output for 5.4.16
'!== null' was faster by 25.22 percent.
Output for 5.4.15
'!== null' was faster by 22.96 percent.
Output for 5.4.14
'!== null' was faster by 31.60 percent.
Output for 5.4.13
'!== null' was faster by 23.67 percent.
Output for 5.4.12
'!== null' was faster by 25.31 percent.
Output for 5.4.11
'!== null' was faster by 22.23 percent.
Output for 5.4.10
'!== null' was faster by 23.84 percent.
Output for 5.4.9
'!== null' was faster by 15.22 percent.
Output for 5.4.7
'!== null' was faster by 23.04 percent.
Output for 5.4.6
'!== null' was faster by 9.18 percent.
Output for 5.4.5
'!== null' was faster by 9.99 percent.
Output for 5.4.4
'!== null' was faster by 23.33 percent.
Output for 5.4.3
'!== null' was faster by 31.25 percent.
Output for 5.4.2
'!== null' was faster by 33.55 percent.
Output for 5.4.1
'!== null' was faster by 14.30 percent.
Output for 5.4.0
'!== null' was faster by 34.42 percent.
Output for 5.3.29
'!== null' was faster by 95.38 percent.
Output for 5.3.28
'!== null' was faster by 84.11 percent.
Output for 5.3.27
'!== null' was faster by 99.48 percent.
Output for 5.3.26
'!== null' was faster by 46.73 percent.
Output for 5.3.25
'!== null' was faster by 96.35 percent.
Output for 5.3.24
'!== null' was faster by 112.25 percent.
Output for 5.3.23
'!== null' was faster by 104.59 percent.
Output for 5.3.22
'!== null' was faster by 101.29 percent.
Output for 5.3.21
'!== null' was faster by 82.84 percent.
Output for 5.3.20
'!== null' was faster by 91.88 percent.
Output for 5.3.19
'!== null' was faster by 67.61 percent.
Output for 5.3.18
'!== null' was faster by 91.00 percent.
Output for 5.3.17
'!== null' was faster by 94.82 percent.
Output for 5.3.16
'!== null' was faster by 111.69 percent.
Output for 5.3.15
'!== null' was faster by 85.98 percent.
Output for 5.3.14
'!== null' was faster by 102.58 percent.
Output for 5.3.13
'!== null' was faster by 88.81 percent.
Output for 5.3.12
'!== null' was faster by 97.07 percent.
Output for 5.3.11
'!== null' was faster by 87.47 percent.
Output for 5.3.10
'!== null' was faster by 87.04 percent.
Output for 5.3.9
'!== null' was faster by 102.23 percent.
Output for 5.3.8
'!== null' was faster by 89.84 percent.
Output for 5.3.7
'!== null' was faster by 92.42 percent.
Output for 5.3.6
'!== null' was faster by 153.17 percent.
Output for 5.3.5
'!== null' was faster by 110.15 percent.
Output for 5.3.4
'!== null' was faster by 99.68 percent.
Output for 5.3.3
'!== null' was faster by 103.98 percent.
Output for 5.3.2
'!== null' was faster by 126.63 percent.
Output for 5.3.1
'!== null' was faster by 100.06 percent.
Output for 5.3.0
'!== null' was faster by 113.53 percent.
Output for 5.2.17
'!== null' was faster by 77.77 percent.
Output for 5.2.16
'!== null' was faster by 74.45 percent.
Output for 5.2.15
'!== null' was faster by 67.16 percent.
Output for 5.2.14
'!== null' was faster by 66.64 percent.
Output for 5.2.13
'!== null' was faster by 61.19 percent.
Output for 5.2.12
'!== null' was faster by 70.55 percent.
Output for 5.2.11
'!== null' was faster by 72.76 percent.
Output for 5.2.10
'!== null' was faster by 72.05 percent.
Output for 5.2.9
'!== null' was faster by 80.36 percent.
Output for 5.2.8
'!== null' was faster by 70.47 percent.
Output for 5.2.7
'!== null' was faster by 65.09 percent.
Output for 5.2.6
'!== null' was faster by 70.61 percent.
Output for 5.2.5
'!== null' was faster by 71.62 percent.
Output for 5.2.4
'!== null' was faster by 64.04 percent.
Output for 5.2.3
'!== null' was faster by 45.92 percent.
Output for 5.2.2
'!== null' was faster by 75.09 percent.
Output for 5.2.1
'!== null' was faster by 86.96 percent.
Output for 5.2.0
'!== null' was faster by 68.06 percent.
Output for 5.1.6
'!== null' was faster by 64.91 percent.
Output for 5.1.5
'!== null' was faster by 55.57 percent.
Output for 5.1.4
'!== null' was faster by 70.58 percent.
Output for 5.1.3
'!== null' was faster by 67.67 percent.
Output for 5.1.2
'!== null' was faster by 21.23 percent.
Output for 5.1.1
'!== null' was faster by 21.29 percent.
Output for 5.1.0
'!== null' was faster by 28.76 percent.
Output for 5.0.5
'!== null' was faster by 8.33 percent.
Output for 5.0.4
'!== null' was faster by 10.12 percent.
Output for 5.0.3
'!== null' was faster by 8.74 percent.
Output for 5.0.2
'!== null' was faster by 12.17 percent.
Output for 5.0.1
'!== null' was faster by 20.33 percent.
Output for 5.0.0
'!== null' was faster by 14.99 percent.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/pcKQB on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/pcKQB on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/pcKQB on line 11
Process exited with code 255.