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); printf("'=== null' was faster"); } else { $p = (($time2-$time1)/$time1) * 100; //printf("'instanceof' was faster by %.2f percent.", $p); printf("'!instanceof' was faster"); }

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.0000.01619.56
7.1.70.0140.00417.10
7.1.60.0040.01117.36
7.1.50.0070.00717.02
7.1.00.0000.08022.45
7.0.200.0030.01316.61
7.0.140.0030.07021.95
7.0.110.0470.04720.04
7.0.100.0500.06720.07
7.0.90.0530.07020.02
7.0.80.0400.07719.93
7.0.70.0370.04319.92
7.0.60.0470.04719.89
7.0.50.0400.06319.88
7.0.40.0070.05019.71
7.0.30.0100.03719.75
7.0.20.0030.04019.86
7.0.10.0030.05719.73
7.0.00.0000.05019.64
5.6.280.0070.07321.10
5.6.260.0030.08020.50
5.6.250.0030.06720.65
5.6.240.0100.07720.57
5.6.230.0000.05020.68
5.6.220.0070.06020.67
5.6.210.0030.06320.39
5.6.200.0130.03020.65
5.6.190.0070.08720.68
5.6.180.0100.04020.55
5.6.170.0000.04320.65
5.6.160.0030.08020.65
5.6.150.0170.07320.55
5.6.140.0100.06020.63
5.6.130.0070.06320.68
5.6.120.0100.06320.64
5.6.110.0000.04320.56
5.6.100.0100.05320.59
5.6.90.0070.07020.60
5.6.80.0070.04019.92
5.6.70.0070.07720.02
5.6.60.0000.04320.07
5.6.50.0200.06719.93
5.6.40.0100.03019.95
5.6.30.0070.08019.98
5.6.20.0070.08019.98
5.6.10.0030.05719.97
5.6.00.0030.04319.82
5.5.380.0100.07317.63
5.5.370.0070.07317.63
5.5.360.0030.04017.62
5.5.350.0000.06017.61
5.5.340.0030.04017.87
5.5.330.0100.03317.77
5.5.320.0030.03718.01
5.5.310.0030.04018.02
5.5.300.0130.08017.75
5.5.290.0030.07718.06
5.5.280.0030.04717.84
5.5.270.0070.03018.13
5.5.260.0030.04017.88
5.5.250.0100.07317.68
5.5.240.0170.02717.15
5.5.230.0100.08017.39
5.5.220.0170.06717.23
5.5.210.0130.06717.39
5.5.200.0100.07017.48
5.5.190.0070.08017.38
5.5.180.0070.07717.21
5.5.160.0070.07317.37
5.5.150.0070.08017.47
5.5.140.0070.08017.24
5.5.130.0030.04717.36
5.5.120.0070.04317.48
5.5.110.0030.04717.43
5.5.100.0070.07717.24
5.5.90.0170.07317.11
5.5.80.0070.05017.11
5.5.70.0000.05317.49
5.5.60.0030.07317.01
5.5.50.0070.04017.36
5.5.40.0100.07317.34
5.5.30.0070.05017.22
5.5.20.0070.08017.39
5.5.10.0130.07317.22
5.5.00.0070.03717.07
5.4.450.0070.06719.43
5.4.440.0030.07719.30
5.4.430.0000.06019.26
5.4.420.0100.06019.41
5.4.410.0070.03719.37
5.4.400.0000.06018.91
5.4.390.0100.06319.25
5.4.380.0130.07319.23
5.4.370.0030.03719.10
5.4.360.0070.07719.08
5.4.350.0070.05719.02
5.4.340.0070.07018.97
5.4.320.0200.04719.26
5.4.310.0070.07319.05
5.4.300.0130.07019.10
5.4.290.0170.06319.02
5.4.280.0130.07318.99
5.4.270.0100.07019.14
5.4.260.0030.07719.02
5.4.250.0100.06318.99
5.4.240.0100.07019.08
5.4.230.0100.06019.02
5.4.220.0070.07719.07
5.4.210.0070.06019.17
5.4.200.0030.03719.17
5.4.190.0070.04019.09
5.4.180.0070.05319.06
5.4.170.0100.05319.16
5.4.160.0030.04719.06
5.4.150.0070.08319.00
5.4.140.0000.03716.45
5.4.130.0100.04316.22
5.4.120.0030.03316.25
5.4.110.0070.07016.36
5.4.100.0070.06016.28
5.4.90.0000.07716.36
5.4.80.0000.05016.27
5.4.70.0070.07016.34
5.4.60.0030.06316.26
5.4.50.0170.05716.09
5.4.40.0000.05316.55
5.4.30.0070.06716.34
5.4.20.0070.06716.31
5.4.10.0100.03316.48
5.4.00.0100.05715.66
5.3.290.0030.07014.73
5.3.280.0030.04014.50
5.3.270.0030.07014.67
5.3.260.0100.08014.55
5.3.250.0030.07714.70
5.3.240.0000.07714.50
5.3.230.0130.07014.43
5.3.220.0070.07014.59
5.3.210.0000.04014.56
5.3.200.0070.03714.45
5.3.190.0070.06314.39
5.3.180.0070.05314.68
5.3.170.0070.07714.35
5.3.160.0070.05314.66
5.3.150.0130.06314.41
5.3.140.0000.06714.43
5.3.130.0030.05314.45
5.3.120.0030.07714.39
5.3.110.0100.03714.38
5.3.100.0070.04013.90
5.3.90.0030.03713.96
5.3.80.0070.04014.07
5.3.70.0070.06714.11
5.3.60.0030.06313.93
5.3.50.0070.03713.84
5.3.40.0000.04013.80
5.3.30.0000.05013.77
5.3.20.0000.04013.61
5.3.10.0030.05013.75
5.3.00.0030.04013.55
5.2.170.0030.04711.91
5.2.160.0030.03311.91
5.2.150.0000.04311.91
5.2.140.0000.03311.91
5.2.130.0030.03011.91
5.2.120.0030.02711.91
5.2.110.0070.02711.91
5.2.100.0000.03311.91
5.2.90.0030.03311.91
5.2.80.0000.03011.91
5.2.70.0030.03011.91
5.2.60.0000.03011.91
5.2.50.0130.02011.91
5.2.40.0030.02711.91
5.2.30.0000.02711.91
5.2.20.0000.03311.91
5.2.10.0070.02311.91
5.2.00.0030.02711.91
5.1.60.0030.02011.91
5.1.50.0000.02711.91
5.1.40.0000.02711.91
5.1.30.0030.03011.91
5.1.20.0000.02311.91
5.1.10.0030.02711.91
5.1.00.0000.02311.91
5.0.50.0000.02011.91
5.0.40.0100.02311.91
5.0.30.0030.02711.91
5.0.20.0000.02011.91
5.0.10.0030.01711.91
5.0.00.0030.03011.91
4.4.90.0100.00311.91
4.4.80.0030.01311.91
4.4.70.0000.01711.91
4.4.60.0000.01311.91
4.4.50.0000.01311.91
4.4.40.0000.02011.91
4.4.30.0000.01711.91
4.4.20.0000.01711.91
4.4.10.0030.01011.91
4.4.00.0000.02011.91
4.3.110.0000.01311.91
4.3.100.0000.01311.91
4.3.90.0030.01011.91
4.3.80.0000.02311.91
4.3.70.0030.01011.91
4.3.60.0000.01311.91
4.3.50.0030.01011.91
4.3.40.0000.02011.91
4.3.30.0000.01311.91
4.3.20.0000.01311.91
4.3.10.0000.01311.91
4.3.00.0000.01311.91

preferences:
29.46 ms | 401 KiB | 5 Q