3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); $var = null; for ($i = 0; $i < 1000000; $i++) { $condition = $var === null; } return microtime(true) - $s; } function test2() { $s = microtime(true); $var = null; for ($i = 0; $i < 1000000; $i++) { $condition = !isset($var); } return microtime(true) - $s; } function test3() { $s = microtime(true); $var = null; for ($i = 0; $i < 1000000; $i++) { $condition = !empty($var); } return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n"; echo test3() . "\n\n";

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.4.10.0070.07414.70
7.4.00.0100.06915.19
7.3.130.0030.08614.96
7.3.120.0100.05915.07
7.3.110.0030.08314.81
7.3.100.0000.06114.79
7.3.90.0070.05614.74
7.3.80.0070.05215.14
7.3.70.0030.05714.65
7.3.60.0070.06114.77
7.3.50.0100.05514.94
7.3.40.0000.06014.61
7.3.30.0030.07014.46
7.3.20.0070.07616.85
7.3.10.0140.05416.64
7.3.00.0120.05816.41
7.2.260.0160.07614.99
7.2.250.0100.08515.15
7.2.240.0070.05515.01
7.2.230.0060.07815.22
7.2.220.0070.06614.82
7.2.210.0070.05615.12
7.2.200.0160.05115.13
7.2.190.0100.05715.07
7.2.180.0030.06215.02
7.2.170.0000.06015.09
7.2.160.0030.07515.05
7.2.150.0000.06616.76
7.2.140.0030.06416.96
7.2.130.0100.06116.82
7.2.120.0070.06616.88
7.2.110.0100.05716.70
7.2.100.0080.06116.82
7.2.90.0070.07116.92
7.2.80.0120.07116.68
7.2.70.0070.06516.61
7.2.60.0100.06616.62
7.2.50.0080.05916.87
7.2.40.0100.06316.73
7.2.30.0100.06416.85
7.2.20.0050.06516.73
7.2.10.0030.06816.58
7.2.00.0040.06417.86
7.1.330.0030.15815.66
7.1.320.0070.16415.90
7.1.310.0070.17715.86
7.1.300.0000.17615.69
7.1.290.0070.15915.96
7.1.280.0000.17015.86
7.1.270.0070.17615.59
7.1.260.0030.17815.81
7.1.250.0080.16615.68
7.1.240.0030.19515.77
7.1.230.0000.16915.96
7.1.220.0070.16615.76
7.1.210.0030.18915.86
7.1.200.0110.16615.92
7.1.190.0070.16015.86
7.1.180.0030.18115.96
7.1.170.0070.15915.87
7.1.160.0030.17515.70
7.1.150.0030.17115.75
7.1.140.0030.16615.66
7.1.130.0030.17115.81
7.1.120.0030.18916.03
7.1.110.0070.20515.86
7.1.100.0070.15815.90
7.1.90.0070.20615.94
7.1.80.0070.17015.65
7.1.70.0030.12216.50
7.1.60.0030.13317.63
7.1.50.0030.14016.12
7.1.40.0030.22215.66
7.1.30.0000.17515.86
7.1.20.0030.15715.81
7.1.10.0000.18115.89
7.1.00.0000.16219.06
7.0.330.0000.17015.52
7.0.320.0070.16715.16
7.0.310.0030.19215.38
7.0.300.0070.18315.27
7.0.290.0070.17315.19
7.0.280.0030.18015.50
7.0.270.0000.19415.29
7.0.260.0100.15915.38
7.0.250.0000.19415.35
7.0.240.0070.21015.42
7.0.230.0070.16915.43
7.0.220.0030.17515.21
7.0.210.0000.16315.33
7.0.200.0030.11615.95
7.0.190.0030.17115.47
7.0.180.0000.18415.40
7.0.170.0100.15715.46
7.0.160.0070.16215.68
7.0.150.0000.17015.45
7.0.140.0050.15418.70
7.0.130.0030.16215.31
7.0.120.0030.16415.45
7.0.110.0070.21515.46
7.0.100.0030.18515.54
7.0.90.0070.17415.52
7.0.80.0000.17715.50
7.0.70.0070.16415.46
7.0.60.0070.15017.75
7.0.50.0120.14116.73
7.0.40.0050.15316.80
7.0.30.0270.16016.79
7.0.20.0170.15316.81
7.0.10.0130.12816.78
7.0.00.0180.11916.94
5.6.400.0100.39814.26
5.6.390.0030.40814.71
5.6.380.0070.34814.23
5.6.370.0000.37614.34
5.6.360.0070.37014.12
5.6.350.0030.37914.51
5.6.340.0070.39114.59
5.6.330.0030.39914.50
5.6.320.0000.36014.54
5.6.310.0070.39814.23
5.6.300.0030.36914.54
5.6.290.0070.36514.34
5.6.280.0030.34317.58
5.6.270.0070.35514.34
5.6.260.0160.35714.44
5.6.250.0070.38514.30
5.6.240.0000.39414.42
5.6.230.0100.39914.54
5.6.220.0100.37814.31
5.6.210.0170.29517.39
5.6.200.0030.28316.30
5.6.190.0080.25917.54
5.6.180.0080.25317.58
5.6.170.0150.26917.29
5.6.160.0120.27917.50
5.6.150.0070.28816.14
5.6.140.0080.31216.37
5.6.130.0070.30216.21
5.6.120.0050.28117.59
5.6.110.0030.29417.93
5.6.100.0030.28317.66
5.6.90.0080.30417.64
5.6.80.0130.27017.29
5.6.70.2030.25717.28
5.6.60.0000.36213.93
5.6.50.0130.36914.25
5.6.40.0070.38714.26
5.6.30.0000.43714.38
5.6.20.0030.35814.34
5.6.10.0000.37914.42
5.6.00.0100.35114.06
5.5.380.0030.35714.22
5.5.370.0070.40014.18
5.5.360.0070.38614.34
5.5.350.0080.30717.33
5.5.340.0030.28416.29
5.5.330.0070.26217.36
5.5.320.0150.26417.54
5.5.310.0100.27517.27
5.5.300.0020.27716.30
5.5.290.0070.28916.07
5.5.280.0080.29117.61
5.5.270.0050.29617.56
5.5.260.0070.30417.55
5.5.250.0050.28317.42
5.5.240.0150.28017.40
5.5.230.0030.42914.16
5.5.220.0070.37514.20
5.5.210.0070.37514.34
5.5.200.0070.42414.17
5.5.190.0000.38314.15
5.5.180.0030.37514.41
5.5.170.0030.38514.08
5.5.160.0100.39814.39
5.5.150.0110.38213.93
5.5.140.0070.38414.11
5.5.130.0000.36914.47
5.5.120.0030.46014.01
5.5.110.0070.38614.30
5.5.100.0030.36814.20
5.5.90.0070.40013.95
5.5.80.0000.36014.48
5.5.70.0030.40814.34
5.5.60.0070.35914.20
5.5.50.0030.39014.36
5.5.40.0030.39313.99
5.5.30.0070.38914.41
5.5.20.0070.35514.01
5.5.10.0030.38513.75
5.5.00.0120.37914.35
5.4.450.0480.29815.12
5.4.440.0080.31515.33
5.4.430.0200.31315.29
5.4.420.0120.31415.21
5.4.410.0150.30415.31
5.4.400.0070.28015.07
5.4.390.0130.31915.21
5.4.380.0320.29414.98
5.4.370.0100.29514.79
5.4.360.0130.32414.91
5.4.350.0180.28914.99
5.4.340.0170.29214.87
5.4.330.0030.40210.91
5.4.320.0070.26211.71
5.4.310.0040.25711.64
5.4.300.0020.27011.76
5.4.290.0050.25711.88
5.4.280.0070.28611.81
5.4.270.0060.29211.66
5.4.260.0050.27011.76
5.4.250.0050.25711.76
5.4.240.0090.30411.56
5.4.230.0090.32711.74
5.4.220.0040.32811.76
5.4.210.0100.34211.53
5.4.200.0100.26111.85
5.4.190.0080.27111.68
5.4.180.0080.28711.69
5.4.170.0080.28411.70
5.4.160.0080.29211.77
5.4.150.0090.30511.42
5.4.140.0080.30111.52
5.4.130.0040.27311.57
5.4.120.0070.27311.46
5.4.110.0090.33611.50
5.4.100.0040.28211.51
5.4.90.0110.33511.58
5.4.80.0070.34411.57
5.4.70.0080.27211.46
5.4.60.0020.26611.46
5.4.50.0040.25911.53
5.4.40.0070.27211.57
5.4.30.0080.27811.43
5.4.20.0090.32211.50
5.4.10.0050.29511.54
5.4.00.0050.29111.24
5.3.290.0080.30311.79
5.3.280.0070.29111.69
5.3.270.0030.31111.71
5.3.260.0100.30711.76
5.3.250.0090.29811.68
5.3.240.0090.35511.49
5.3.230.0050.35011.67
5.3.220.0120.35211.45
5.3.210.0100.31911.44
5.3.200.0050.31211.50
5.3.190.0050.31411.56
5.3.180.0020.33811.66
5.3.170.0070.36111.53
5.3.160.0050.32611.53
5.3.150.0090.33511.62
5.3.140.0060.31811.60
5.3.130.0040.30911.62
5.3.120.0100.36911.63
5.3.110.0080.38811.61
5.3.100.0050.37311.19
5.3.90.0080.35511.42
5.3.80.0080.34911.17
5.3.70.0100.35811.25
5.3.60.0080.35311.29
5.3.50.0040.34611.26
5.3.40.0060.31511.28
5.3.30.0060.35211.37
5.3.20.0110.32411.12
5.3.10.0060.30511.02
5.3.00.0040.31210.99
5.2.170.0070.3069.21
5.2.160.0070.3109.21
5.2.150.0100.4259.21
5.2.140.0130.5109.21
5.2.130.0120.4539.17
5.2.120.0090.3779.16
5.2.110.0220.5049.17
5.2.100.0050.4629.17
5.2.90.0110.3949.16
5.2.80.0080.4559.16
5.2.70.0080.2929.16
5.2.60.0100.4619.11
5.2.50.0110.3979.09
5.2.40.0090.2969.06
5.2.30.0040.2719.03
5.2.20.0060.2789.02
5.2.10.0070.4608.95
5.2.00.0140.3558.82
5.1.60.0060.2968.10
5.1.50.0080.3948.10
5.1.40.0120.3908.08
5.1.30.0100.4748.43
5.1.20.0050.3188.45
5.1.10.0130.3888.18
5.1.00.0070.5008.18
5.0.50.0151.1446.66
5.0.40.0230.9976.51
5.0.30.0091.0556.32
5.0.20.0100.6516.29
5.0.10.0120.8296.27
5.0.00.0080.8186.27
4.4.90.0091.0694.78
4.4.80.0241.2644.76
4.4.70.0251.0784.75
4.4.60.0151.2534.76
4.4.50.0341.6814.77
4.4.40.0151.1414.71
4.4.30.0221.2064.76
4.4.20.0271.2474.85
4.4.10.0091.0614.85
4.4.00.0091.1094.76
4.3.110.0080.7974.67
4.3.100.0061.1764.66
4.3.90.0061.0504.64
4.3.80.0100.9894.59
4.3.70.0070.8384.63
4.3.60.0080.8654.63
4.3.50.0091.0204.63
4.3.40.0020.9674.54
4.3.30.0031.0413.34
4.3.20.0081.0573.32
4.3.10.0061.0143.28
4.3.00.0000.55010.30

preferences:
38.82 ms | 401 KiB | 5 Q