3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = array(); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = array(); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { (! $array ); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = array(); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array !== []); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; 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.2.00.0060.00819.51
7.1.70.0100.00817.12
7.1.60.0040.02119.39
7.1.50.0030.01716.98
7.1.00.0070.06722.57
7.0.200.0110.00016.46
7.0.140.0100.06722.11
7.0.60.0270.06019.86
7.0.50.0030.08717.96
7.0.40.0030.05020.11
7.0.30.0300.04720.13
7.0.20.0300.07720.16
7.0.10.0070.08720.22
7.0.00.0130.03720.07
5.6.280.0000.07720.93
5.6.210.0100.07720.55
5.6.200.0100.04718.20
5.6.190.0100.03720.77
5.6.180.0300.03720.61
5.6.170.0370.07320.44
5.6.160.0030.04320.46
5.6.150.0030.08718.25
5.6.140.0070.04018.11
5.6.130.0070.04018.27
5.6.120.0030.04320.97
5.6.110.0100.08721.14
5.6.100.0130.08021.02
5.6.90.0100.06021.13
5.6.80.0030.06720.52
5.6.70.4600.03720.38
5.5.350.0070.07320.34
5.5.340.0030.04017.93
5.5.330.0070.04320.43
5.5.320.0000.05720.31
5.5.310.0230.07720.32
5.5.300.0030.08318.06
5.5.290.0070.05318.03
5.5.280.0170.06020.87
5.5.270.0200.07020.80
5.5.260.0170.07320.65
5.5.250.0170.07720.59
5.5.240.0200.04020.08
5.4.450.0170.07019.17
5.4.440.0930.07319.59
5.4.430.0630.06319.38
5.4.420.0800.05019.16
5.4.410.0270.05319.21
5.4.400.0230.04719.27
5.4.390.0200.08019.13
5.4.380.0230.06318.73
5.4.370.0300.05018.72
5.4.360.0370.04018.48
5.4.350.0300.05018.61
5.4.340.0370.04718.70
5.4.320.0050.04012.51
5.4.310.0080.03912.50
5.4.300.0070.04112.51
5.4.290.0040.04112.50
5.4.280.0290.05412.38
5.4.270.0120.05012.38
5.4.260.0110.06812.38
5.4.250.0100.05212.38
5.4.240.0110.04912.38
5.4.230.0080.05312.37
5.4.220.0130.06912.37
5.4.210.0100.04912.37
5.4.200.0100.07112.37
5.4.190.0070.05112.37
5.4.180.0210.05512.37
5.4.170.0170.06112.37
5.4.160.0160.05012.37
5.4.150.0080.04612.37
5.4.140.0110.03712.05
5.4.130.0110.04712.04
5.4.120.0070.05012.00
5.4.110.0100.05112.00
5.4.100.0150.05312.00
5.4.90.0120.03911.99
5.4.80.0120.11611.99
5.4.70.0090.06211.98
5.4.60.0110.05211.99
5.4.50.0120.07111.99
5.4.40.0080.05111.98
5.4.30.0150.07311.98
5.4.20.0170.06811.97
5.4.10.0090.05311.97
5.4.00.0100.05111.47
5.3.290.0050.04612.80
5.3.280.0170.07212.71
5.3.270.0080.05212.73
5.3.260.0210.05212.72
5.3.250.0230.07112.72
5.3.240.0140.05612.72
5.3.230.0120.04812.71
5.3.220.0180.07212.68
5.3.210.0070.04512.68
5.3.200.0080.03912.68
5.3.190.0060.04512.68
5.3.180.0140.04812.67
5.3.170.0170.08312.67
5.3.160.0170.06612.68
5.3.150.0100.05412.67
5.3.140.0110.06112.66
5.3.130.0140.08412.65
5.3.120.0250.08112.66
5.3.110.0200.11712.66
5.3.100.0130.07612.12
5.3.90.0130.06812.09
5.3.80.0180.06312.08
5.3.70.0120.06012.07
5.3.60.0150.07512.06
5.3.50.0300.11412.00
5.3.40.0180.06812.00
5.3.30.0110.05511.96
5.3.20.0200.08111.75
5.3.10.0190.10511.71
5.3.00.0140.05711.70
5.2.170.0060.0539.20
5.2.160.0100.0649.19
5.2.150.0150.0549.19
5.2.140.0310.0639.19
5.2.130.0110.1049.15
5.2.120.0240.0649.15
5.2.110.0150.0559.16
5.2.100.0100.0399.16
5.2.90.0060.0449.16
5.2.80.0090.0429.15
5.2.70.0090.0429.16
5.2.60.0450.0839.11
5.2.50.0060.0439.08
5.2.40.0160.0539.05
5.2.30.0070.0439.03
5.2.20.0110.0529.02
5.2.10.0130.0698.93
5.2.00.0180.0588.79
5.1.60.0250.0498.07
5.1.50.0360.0958.08
5.1.40.0200.0538.06
5.1.30.0180.0498.40
5.1.20.0140.0588.43
5.1.10.0080.0368.16
5.1.00.0070.0378.16
5.0.50.0050.0316.63
5.0.40.0070.0296.50
5.0.30.0140.0576.30
5.0.20.0060.0236.27
5.0.10.0030.0426.26
5.0.00.0090.0566.24
4.4.90.0030.0234.78
4.4.80.0050.0164.75
4.4.70.0000.0204.76
4.4.60.0040.0164.76
4.4.50.0070.0144.77
4.4.40.0060.0244.71
4.4.30.0050.0164.75
4.4.20.0030.0234.84
4.4.10.0160.0214.85
4.4.00.0030.0324.76
4.3.110.0110.0364.67
4.3.100.0020.0324.66
4.3.90.0050.0244.63
4.3.80.0050.0384.58
4.3.70.0050.0234.63
4.3.60.0050.0214.63
4.3.50.0060.0214.63
4.3.40.0060.0304.54
4.3.30.0050.0153.30
4.3.20.0010.0193.28
4.3.10.0020.0173.25
4.3.00.0270.01710.30

preferences:
35.84 ms | 401 KiB | 5 Q