3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = array(); unset($array); /* The Test */ $t = microtime(true); while($i < 2000) { empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = array(); unset($array); /* The Test */ $t = microtime(true); while($i < 2000) { ($array == []); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = array(); unset($array); /* The Test */ $t = microtime(true); while($i < 2000) { ($array === []); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo '<hr>-----'; TestEmpty2(); echo '<hr>-----'; TestEmpty3();

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.3.10.0080.00816.02
7.3.00.0160.01016.45
7.2.130.0120.00816.27
7.2.120.0210.00616.39
7.2.110.0170.00316.65
7.2.100.0140.00616.33
7.2.90.0140.01116.83
7.2.80.0170.00816.57
7.2.70.0070.01016.61
7.2.60.0190.00616.33
7.2.50.0210.00216.60
7.2.40.0150.00716.52
7.2.30.0190.01516.29
7.2.20.0170.01316.77
7.2.10.0130.00916.80
7.2.00.0100.00717.99
7.1.250.0110.00615.23
7.1.70.0000.00916.86
7.1.60.0140.01119.33
7.1.50.0070.00716.96
7.1.00.0030.07322.19
7.0.200.4320.00314.94
7.0.140.0100.06721.92
7.0.60.0030.07719.97
7.0.50.0100.07317.79
7.0.40.0170.07719.73
7.0.30.0130.06319.84
7.0.20.0470.04019.97
7.0.10.0170.07719.91
7.0.00.0030.08719.97
5.6.280.0030.07720.88
5.6.210.0000.04320.61
5.6.200.0030.08018.14
5.6.190.0100.04720.36
5.6.180.0100.07020.38
5.6.170.0200.07020.45
5.6.160.0170.07720.40
5.6.150.0100.07718.15
5.6.140.0100.06018.22
5.6.130.0100.05318.11
5.6.120.0030.08721.10
5.6.110.0030.09021.02
5.6.100.0030.05720.99
5.6.90.0070.08720.94
5.6.80.0070.07320.41
5.5.350.0100.05720.58
5.5.340.0100.06317.98
5.5.330.0100.07720.16
5.5.320.0230.04020.14
5.5.310.0330.03319.97
5.5.300.0070.06020.78
5.5.290.0100.06020.94
5.5.280.0100.06320.94
5.5.270.0070.07020.95
5.5.260.0100.04320.68
5.5.250.0130.06320.55
5.5.240.0170.05020.25
5.4.450.0200.04319.37
5.4.440.0370.06319.50
5.4.430.0200.04719.21
5.4.420.0130.05019.21
5.4.410.0270.06319.38
5.4.400.0230.06018.94
5.4.390.0230.03719.07
5.4.380.0230.07719.26
5.4.370.0200.03019.18
5.4.360.0070.05719.23
5.4.350.0230.03318.93
5.4.340.0170.05319.03
5.4.320.0270.07318.79
5.4.310.0330.07319.04
5.4.300.0300.04318.88
5.4.290.0470.05319.04
5.4.280.0050.04312.38
5.4.270.0080.04212.37
5.4.260.0170.04719.07
5.4.250.0250.07512.38
5.4.240.0140.06612.38
5.4.230.0090.06312.37
5.4.220.0180.05612.38
5.4.210.0070.06412.37
5.4.200.0180.05512.37
5.4.190.0080.05812.37
5.4.180.0100.05412.37
5.4.170.0100.06018.95
5.4.160.3770.03318.92
5.4.150.0130.05319.02
5.4.140.3430.03316.35
5.4.130.0070.05716.25
5.4.120.0030.06016.25
5.4.110.0200.07016.26
5.4.100.0130.03716.54
5.4.90.0130.07316.22
5.4.80.0300.04016.14
5.4.70.0070.06316.27
5.4.60.0270.06316.52
5.4.50.0230.03716.53
5.4.40.0000.06016.45
5.4.30.0070.06716.43
5.4.20.0030.07316.35
5.4.10.0130.07316.27
5.4.00.0070.05715.70
5.3.290.3870.04014.91
5.3.280.3900.03714.61
5.3.270.3370.03714.85
5.3.260.3630.03314.76
5.3.250.3500.04314.51
5.3.240.4170.03314.66
5.3.230.2870.04314.60
5.3.220.0200.04314.59
5.3.210.3400.03314.47
5.3.200.0270.06314.47
5.3.190.2970.04014.55
5.3.180.0330.06314.54
5.3.170.0300.06714.57
5.3.160.0570.05014.68
5.3.150.0170.03714.58
5.3.140.0300.04014.45
5.3.130.2730.04014.55
5.3.120.0430.04714.56
5.3.110.0500.03014.61
5.3.100.0430.04314.01
5.3.90.0370.07013.94
5.3.80.0400.05313.95
5.3.70.0300.07314.03
5.3.60.0330.03714.08
5.3.50.0400.06314.04
5.3.40.3530.03314.18
5.3.30.0530.06313.82
5.3.20.0470.07013.70
5.3.10.0430.06313.77
5.3.00.0500.06313.55
5.2.170.0370.05311.84
5.2.160.0300.03711.80
5.2.150.0400.05711.84
5.2.140.2530.02711.86
5.2.130.2670.02711.88
5.2.120.0370.03311.88
5.2.110.0530.04711.88
5.2.100.0370.06311.84
5.2.90.0330.03311.85
5.2.80.0330.06011.84
5.2.70.0330.02711.85
5.2.60.0330.05711.87
5.2.50.0470.05011.87
5.2.40.0300.03311.82
5.2.30.0370.02711.85
5.2.20.0400.05011.85
5.2.10.0400.05011.82
5.2.00.0000.04711.82
5.1.60.0230.03011.88
5.1.50.0200.02711.88
5.1.40.0270.03313.81
5.1.30.0030.05313.86
5.1.20.0030.03313.88
5.1.10.0430.04013.86
5.1.00.0270.03313.88
5.0.50.0200.04013.86
5.0.40.0170.03013.88
5.0.30.0200.06313.88
5.0.20.0200.03713.88
5.0.10.0030.04313.83
5.0.00.0030.02713.88
4.4.90.0000.02713.84
4.4.80.0000.01713.88
4.4.70.0130.02313.80
4.4.60.0000.01313.84
4.4.50.0100.01713.88
4.4.40.0030.05013.84
4.4.30.0130.01713.88
4.4.20.0100.03313.84
4.4.10.0100.02713.91
4.4.00.0070.06013.91
4.3.110.0070.02013.88
4.3.100.0230.03313.88
4.3.90.0100.01713.91
4.3.80.0100.03713.90
4.3.70.0100.01713.91
4.3.60.0200.03313.91
4.3.50.1400.02313.88
4.3.40.1530.02713.88
4.3.30.0900.02713.91
4.3.20.0770.02013.91
4.3.10.0930.02013.91
4.3.00.0030.01713.91

preferences:
47.45 ms | 401 KiB | 5 Q