3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = null; $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.4.00.0030.01314.81
7.3.120.0030.01414.82
7.3.110.0080.00614.96
7.3.100.0130.00315.08
7.3.90.0030.01014.72
7.3.80.0070.00414.42
7.3.70.0000.01414.51
7.3.60.0030.00614.63
7.3.50.0070.00714.64
7.3.40.0070.00714.81
7.3.30.0070.01014.54
7.3.20.0030.01016.73
7.3.10.0110.00316.56
7.3.00.0070.00816.58
7.2.250.0120.00614.92
7.2.240.0130.00314.95
7.2.230.0070.01015.01
7.2.220.0030.00714.91
7.2.210.0070.01114.67
7.2.200.0070.00714.78
7.2.190.0060.00914.77
7.2.180.0090.00614.91
7.2.170.0070.00714.96
7.2.130.0030.01316.78
7.2.120.0030.01316.82
7.2.110.0070.00316.87
7.2.100.0090.00616.79
7.2.90.0090.00616.95
7.2.80.0030.01316.86
7.2.70.0040.01416.79
7.2.60.0100.00617.03
7.2.50.0030.00716.72
7.2.40.0100.00717.05
7.2.30.0030.00916.64
7.2.20.0030.01216.75
7.2.10.0060.00617.00
7.2.00.0040.01218.03
7.1.330.0030.01015.55
7.1.320.0110.00015.86
7.1.310.0070.00715.68
7.1.300.0000.01015.55
7.1.290.0040.01115.66
7.1.280.0030.00915.84
7.1.270.0030.01315.83
7.1.260.0080.00815.74
7.1.250.0000.01715.86
7.1.70.0070.00017.09
7.1.60.0100.01319.39
7.1.50.0030.01316.94
7.1.00.0070.06022.31
7.0.200.0030.00516.63
7.0.140.0030.07322.18
7.0.60.0130.07719.93
7.0.50.0070.04717.88
7.0.40.0230.07320.20
7.0.30.0570.06720.18
7.0.20.0300.07720.23
7.0.10.0070.08720.07
7.0.00.0030.06020.22
5.6.280.0070.07320.87
5.6.210.0070.08020.73
5.6.200.0170.07018.30
5.6.190.0070.04020.61
5.6.180.0270.05320.67
5.6.170.0370.04320.71
5.6.160.0100.03720.55
5.6.150.0130.07318.18
5.6.140.0070.04318.24
5.6.130.0130.07018.15
5.6.120.0070.07321.13
5.6.110.0070.06320.99
5.6.100.0070.04021.02
5.6.90.0030.05020.96
5.6.80.0230.06020.52
5.6.70.4500.04720.39
5.5.350.0200.07720.44
5.5.340.0170.06717.93
5.5.330.0170.07720.57
5.5.320.0030.05720.41
5.5.310.0370.07020.29
5.5.300.0130.07317.95
5.5.290.0100.03718.09
5.5.280.0070.06320.68
5.5.270.0070.08720.77
5.5.260.0100.06020.84
5.5.250.0230.06720.71
5.5.240.0200.05020.13
5.4.450.0930.06019.54
5.4.440.0530.08319.34
5.4.430.0100.05719.34
5.4.420.0600.06719.69
5.4.410.0730.06019.45
5.4.400.0070.05718.98
5.4.390.0530.08019.01
5.4.380.0230.06018.78
5.4.370.0830.04318.76
5.4.360.0230.05018.74
5.4.350.0230.05318.47
5.4.340.0230.06318.77
5.4.320.0120.03312.51
5.4.310.0100.05212.51
5.4.300.0070.04112.51
5.4.290.0070.04512.50
5.4.280.0090.04812.38
5.4.270.0110.06312.38
5.4.260.0090.05012.38
5.4.250.0110.04712.38
5.4.240.0070.05112.38
5.4.230.0060.05412.37
5.4.220.0110.05212.37
5.4.210.0130.04612.37
5.4.200.0070.04912.37
5.4.190.0110.05412.37
5.4.180.0110.05512.37
5.4.170.0100.05312.38
5.4.160.0170.05812.38
5.4.150.0160.06212.37
5.4.140.0150.06912.05
5.4.130.0160.04912.04
5.4.120.0080.05412.00
5.4.110.0120.06411.99
5.4.100.0110.06912.00
5.4.90.0110.06311.99
5.4.80.0160.06612.00
5.4.70.0150.05511.99
5.4.60.0280.09911.99
5.4.50.0100.06511.99
5.4.40.0120.05411.98
5.4.30.0090.05011.98
5.4.20.0180.06011.97
5.4.10.0170.06911.97
5.4.00.0220.07511.47
5.3.290.0090.05012.80
5.3.280.0220.07012.71
5.3.270.0230.09412.72
5.3.260.0290.08012.71
5.3.250.0160.06812.72
5.3.240.0110.05612.72
5.3.230.0130.05212.71
5.3.220.0170.05512.68
5.3.210.0080.05712.68
5.3.200.0090.07012.68
5.3.190.0190.07312.68
5.3.180.0190.08012.67
5.3.170.0220.07212.67
5.3.160.0120.05912.68
5.3.150.0150.06112.68
5.3.140.0170.08612.66
5.3.130.0140.05912.66
5.3.120.0130.05712.66
5.3.110.0170.07312.66
5.3.100.0310.11712.12
5.3.90.0180.07412.08
5.3.80.0360.12212.07
5.3.70.0120.04912.08
5.3.60.0130.03912.06
5.3.50.0120.06712.00
5.3.40.0110.04812.00
5.3.30.0120.04111.96
5.3.20.0020.04611.75
5.3.10.0070.04111.71
5.3.00.0080.04111.70
5.2.170.0110.0769.19
5.2.160.0120.0539.19
5.2.150.0200.0659.19
5.2.140.0090.0559.19
5.2.130.0090.0409.15
5.2.120.0060.0349.15
5.2.110.0110.0369.16
5.2.100.0070.0349.16
5.2.90.0150.0449.16
5.2.80.0050.0419.16
5.2.70.0310.1059.15
5.2.60.0070.0369.10
5.2.50.0100.0329.08
5.2.40.0110.0359.05
5.2.30.0040.0419.03
5.2.20.0100.0309.01
5.2.10.0090.0338.93
5.2.00.0040.0388.80
5.1.60.0160.0518.07
5.1.50.0260.0418.07
5.1.40.0060.0368.06
5.1.30.0050.0378.41
5.1.20.0210.0898.43
5.1.10.0080.0378.16
5.1.00.0080.0358.16
5.0.50.0070.0266.63
5.0.40.0050.0216.50
5.0.30.0040.0356.30
5.0.20.0030.0306.28
5.0.10.0080.0256.26
5.0.00.0120.0686.25
4.4.90.0080.0384.78
4.4.80.0140.0324.75
4.4.70.0080.0274.75
4.4.60.0100.0414.75
4.4.50.0090.0394.77
4.4.40.0030.0374.71
4.4.30.0170.0364.75
4.4.20.0070.0254.84
4.4.10.0060.0224.85
4.4.00.0090.0474.76
4.3.110.0080.0324.67
4.3.100.0060.0234.67
4.3.90.0140.0294.63
4.3.80.0050.0344.58
4.3.70.0150.0504.63
4.3.60.0140.0444.63
4.3.50.0120.0394.63
4.3.40.0070.0534.54
4.3.30.0080.0403.30
4.3.20.0070.0353.28
4.3.10.0030.0253.25
4.3.00.0030.02310.30

preferences:
37.8 ms | 400 KiB | 5 Q