3v4l.org

run code in 300+ PHP versions simultaneously
<?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); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0060.00619.22
7.1.70.0030.01017.09
7.1.60.0100.01619.40
7.1.50.0040.01816.89
7.1.00.0030.05722.51
7.0.200.0370.00014.38
7.0.140.0030.07722.01
7.0.120.0130.06722.05
7.0.60.0070.03719.99
7.0.50.0000.04317.90
7.0.40.0100.03720.04
7.0.30.0600.06320.30
7.0.20.0370.04020.16
7.0.10.0300.07020.18
7.0.00.0070.05020.19
5.6.280.0070.07321.00
5.6.210.0100.07020.52
5.6.200.0170.07318.17
5.6.190.0130.07720.66
5.6.180.0370.07720.60
5.6.170.0300.07720.50
5.6.160.0030.05720.37
5.6.150.0070.08018.07
5.6.140.0200.05018.11
5.6.130.0000.05318.09
5.6.120.0030.05020.99
5.6.110.0200.08020.89
5.6.100.0130.03720.89
5.6.90.0100.05720.87
5.6.80.0100.07320.53
5.6.70.4300.04320.37
5.5.350.0270.08020.43
5.5.340.0000.08317.93
5.5.330.0000.08720.16
5.5.320.0200.04020.15
5.5.310.0300.05020.16
5.5.300.0000.09317.89
5.5.290.0100.06017.95
5.5.280.0070.06320.88
5.5.270.0030.09020.79
5.5.260.0000.04320.84
5.5.250.0130.05720.68
5.5.240.0030.08020.26
5.4.450.0070.04319.41
5.4.440.0070.06319.11
5.4.430.0070.08019.50
5.4.420.0030.06719.40
5.4.410.0130.05318.98
5.4.400.0100.07319.18
5.4.390.0070.03718.93
5.4.380.0030.05019.18
5.4.370.0100.07719.18
5.4.360.0030.05319.17
5.4.350.0100.05019.18
5.4.340.0130.07019.15
5.4.320.0070.07718.79
5.4.310.0030.04019.08
5.4.300.0070.03719.07
5.4.290.0070.07719.12
5.4.280.0030.08019.15
5.4.270.0100.07319.14
5.4.260.0100.05019.07
5.4.250.0030.04019.18
5.4.240.0130.06318.79
5.4.230.0030.08018.91
5.4.220.0070.08018.99
5.4.210.0070.07718.87
5.4.200.0100.07719.14
5.4.190.0070.03719.01
5.4.180.0100.07019.07
5.4.170.0070.07718.88
5.4.160.0070.08019.06
5.4.150.0030.08319.16
5.4.140.0030.08016.20
5.4.130.0030.06016.37
5.4.120.0070.07316.28
5.4.110.0070.04316.32
5.4.100.0100.07716.32
5.4.90.0130.03716.60
5.4.80.0100.06316.28
5.4.70.0030.05016.32
5.4.60.0000.07316.30
5.4.50.0070.06716.30
5.4.40.0030.08016.36
5.4.30.0100.07316.21
5.4.20.0000.07316.11
5.4.10.0030.04316.29
5.4.00.0100.03315.65
5.3.290.0000.05714.60
5.3.280.0100.07714.57
5.3.270.0100.08014.39
5.3.260.0130.07014.55
5.3.250.0000.04314.55
5.3.240.0130.05314.48
5.3.230.0000.04714.52
5.3.220.0070.05014.49
5.3.210.0030.05314.66
5.3.200.0130.07014.35
5.3.190.0030.08714.49
5.3.180.0100.06714.38
5.3.170.0130.03314.52
5.3.160.0030.04314.55
5.3.150.0130.04314.35
5.3.140.0070.05314.48
5.3.130.0030.07014.49
5.3.120.0000.08014.43
5.3.110.0070.07314.48
5.3.100.0200.06013.98
5.3.90.0170.06013.84
5.3.80.0000.07013.97
5.3.70.0030.07713.99
5.3.60.0070.04314.02
5.3.50.0070.07714.04
5.3.40.0070.07013.89
5.3.30.0030.08013.75
5.3.20.0070.06713.63
5.3.10.0030.04013.59
5.3.00.0070.06713.57
5.2.170.0000.06011.16
5.2.160.0100.04711.13
5.2.150.0100.02710.99
5.2.140.0070.03711.12
5.2.130.0070.05310.96
5.2.120.0070.04011.09
5.2.110.0030.04311.25
5.2.100.0100.05711.00
5.2.90.0070.05011.00
5.2.80.0070.03010.99
5.2.70.0070.03310.99
5.2.60.0100.04710.93
5.2.50.0000.07310.95
5.2.40.0030.05310.89
5.2.30.0030.07010.95
5.2.20.0100.06011.11
5.2.10.0070.06010.86
5.2.00.0030.04310.59
5.1.60.0000.06010.06
5.1.50.0070.05010.14
5.1.40.0030.0609.95
5.1.30.0070.05710.23
5.1.20.0070.05710.44
5.1.10.0030.05310.22
5.1.00.0000.06310.07
5.0.50.0070.0508.64
5.0.40.0000.0338.50
5.0.30.0030.0438.30
5.0.20.0100.0478.21
5.0.10.0030.0538.17
5.0.00.0100.0638.21
4.4.90.0030.0137.91
4.4.80.0030.0337.91
4.4.70.0000.0207.91
4.4.60.0030.0177.91
4.4.50.0070.0237.91
4.4.40.0000.0577.91
4.4.30.0030.0377.91
4.4.20.0000.0407.91
4.4.10.0030.0377.91
4.4.00.0000.0607.91
4.3.110.0030.0307.91
4.3.100.0070.0207.91
4.3.90.0000.0407.91
4.3.80.0000.0277.91
4.3.70.0070.0137.91
4.3.60.0030.0277.91
4.3.50.0030.0137.91
4.3.40.0030.0407.91
4.3.30.0000.0207.91
4.3.20.0000.0177.91
4.3.10.0030.0207.91
4.3.00.0000.0177.91

preferences:
61.03 ms | 400 KiB | 5 Q