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.4.10.0130.00715.16
7.4.00.0100.00615.09
7.3.130.0090.00614.75
7.3.120.0030.01314.83
7.3.110.0070.01014.79
7.3.100.0070.00914.66
7.3.90.0120.00314.95
7.3.80.0020.01014.78
7.3.70.0040.01114.69
7.3.60.0060.00314.59
7.3.50.0080.00514.59
7.3.40.0060.00914.69
7.3.30.0080.00714.79
7.3.20.0040.01116.65
7.3.10.0070.00516.75
7.3.00.0100.00316.69
7.2.260.0160.00615.07
7.2.250.0100.00815.03
7.2.240.0060.00815.04
7.2.230.0070.01014.91
7.2.220.0030.01015.01
7.2.210.0060.00915.05
7.2.200.0050.01215.04
7.2.190.0040.01115.02
7.2.180.0070.00814.90
7.2.170.0070.00914.95
7.2.160.0030.01414.84
7.2.150.0060.01017.08
7.2.140.0060.01216.87
7.2.130.0090.00617.14
7.2.120.0000.01116.76
7.2.110.0060.01016.91
7.2.100.0070.01116.75
7.2.90.0140.00416.57
7.2.80.0060.01216.82
7.2.70.0070.00716.73
7.2.60.0000.01216.45
7.2.50.0150.00316.93
7.2.40.0000.00916.81
7.2.30.0070.01016.94
7.2.20.0090.00916.98
7.2.10.0030.00616.64
7.2.00.0050.01118.10
7.1.330.0060.00815.76
7.1.320.0060.00815.79
7.1.310.0070.00615.77
7.1.300.0030.00915.70
7.1.290.0060.00615.67
7.1.280.0050.00815.71
7.1.270.0070.00715.87
7.1.260.0100.00615.52
7.1.250.0000.01115.96
7.1.240.0070.00715.74
7.1.230.0030.01115.55
7.1.220.0100.00715.40
7.1.210.0030.01115.36
7.1.200.0080.00815.89
7.1.190.0040.01115.55
7.1.180.0090.00315.61
7.1.170.0130.00315.88
7.1.160.0070.00315.64
7.1.150.0030.01315.68
7.1.140.0090.00015.50
7.1.130.0120.00015.71
7.1.120.0030.01015.59
7.1.110.0000.01315.82
7.1.100.0040.01115.64
7.1.90.0000.01515.61
7.1.80.0120.00015.30
7.1.70.0050.00716.32
7.1.60.0170.00317.41
7.1.50.0080.00616.19
7.1.40.0070.00715.59
7.1.30.0080.00415.71
7.1.20.0030.00615.72
7.1.10.0070.00715.11
7.1.00.0050.03218.98
7.0.330.0070.00715.62
7.0.320.0100.00715.23
7.0.310.0030.00915.41
7.0.300.0040.00815.48
7.0.290.0060.00615.23
7.0.280.0070.00715.08
7.0.270.0040.01115.59
7.0.260.0070.00715.50
7.0.250.0000.01615.38
7.0.240.0040.00415.44
7.0.230.0030.00915.34
7.0.220.0060.01115.45
7.0.210.0000.01415.28
7.0.200.0060.00616.11
7.0.190.0040.01115.30
7.0.180.0060.00915.58
7.0.170.0060.00615.32
7.0.160.0080.00515.40
7.0.150.0070.00715.21
7.0.140.0030.04318.78
7.0.130.0060.00615.42
7.0.120.0030.01315.35
7.0.110.0080.00615.24
7.0.100.0060.00315.46
7.0.90.0000.01415.35
7.0.80.0100.00715.55
7.0.70.0040.00715.43
7.0.60.0060.04117.71
7.0.50.0120.03016.64
7.0.40.0060.03116.95
7.0.30.0120.02416.73
7.0.20.0150.02716.89
7.0.10.0050.04216.87
7.0.00.0120.04216.61
5.6.400.0090.00614.12
5.6.390.0120.00014.05
5.6.380.0100.00614.04
5.6.370.0060.00914.17
5.6.360.0000.01814.22
5.6.350.0030.01014.20
5.6.340.0000.01514.06
5.6.330.0060.00914.33
5.6.320.0070.00314.28
5.6.310.0040.00714.45
5.6.300.0090.00614.51
5.6.290.0030.00914.04
5.6.280.0060.04017.60
5.6.270.0030.01214.39
5.6.260.0040.00814.18
5.6.250.0060.00914.26
5.6.240.0100.00714.34
5.6.230.0150.00314.30
5.6.220.0080.00514.24
5.6.210.0080.04017.53
5.6.200.0100.03016.21
5.6.190.0080.02917.49
5.6.180.0170.03117.15
5.6.170.0170.04517.35
5.6.160.0110.04217.28
5.6.150.0100.03816.20
5.6.140.0080.03616.17
5.6.130.0020.03416.28
5.6.120.0050.03217.61
5.6.110.0060.04817.59
5.6.100.0100.04217.57
5.6.90.0110.03317.69
5.6.80.0050.04917.28
5.6.70.2300.02517.26
5.6.60.0030.01314.31
5.6.50.0060.00914.04
5.6.40.0000.01414.43
5.6.30.0030.01214.09
5.6.20.0040.00714.17
5.6.10.0140.00014.40
5.6.00.0000.01214.05
5.5.380.0000.01314.11
5.5.370.0090.00314.11
5.5.360.0070.00714.29
5.5.350.0050.04517.29
5.5.340.0020.03016.04
5.5.330.0060.04617.50
5.5.320.0020.03417.32
5.5.310.0130.04017.08
5.5.300.0030.03616.04
5.5.290.0050.02715.96
5.5.280.0070.03617.55
5.5.270.0050.04017.41
5.5.260.0030.05217.56
5.5.250.0080.04017.41
5.5.240.0070.02217.05
5.5.230.0000.01113.82
5.5.220.0140.00313.88
5.5.210.0030.00913.76
5.5.200.0000.01314.01
5.5.190.0130.00313.96
5.5.180.0030.01214.46
5.5.170.0120.00714.17
5.5.160.0030.01113.93
5.5.150.0040.01114.16
5.5.140.0110.00414.14
5.5.130.0000.01114.12
5.5.120.0120.00414.07
5.5.110.0140.00413.93
5.5.100.0100.00314.27
5.5.90.0000.01613.96
5.5.80.0100.00714.14
5.5.70.0060.00913.98
5.5.60.0080.00613.93
5.5.50.0030.01014.26
5.5.40.0060.00814.13
5.5.30.0060.00913.96
5.5.20.0030.01214.05
5.5.10.0060.00913.92
5.5.00.0000.01713.93
5.4.450.0510.03115.62
5.4.440.0090.03915.56
5.4.430.0310.04515.56
5.4.420.0320.04115.56
5.4.410.0370.03715.49
5.4.400.0330.03115.38
5.4.390.0330.03215.47
5.4.380.0250.03115.07
5.4.370.0180.03315.11
5.4.360.0220.03015.20
5.4.350.0170.03715.14
5.4.340.0120.03315.13
5.4.330.0000.00811.64
5.4.320.0040.02712.08
5.4.310.0070.02312.08
5.4.300.0050.02612.08
5.4.290.0090.02112.07
5.4.280.0020.02612.01
5.4.270.0040.02212.01
5.4.260.0040.02512.01
5.4.250.0080.02812.01
5.4.240.0110.03012.01
5.4.230.0120.03112.01
5.4.220.0080.03512.01
5.4.210.0110.04612.01
5.4.200.0050.03312.01
5.4.190.0100.02512.01
5.4.180.0090.02712.01
5.4.170.0090.02712.01
5.4.160.0080.02712.01
5.4.150.0050.02912.01
5.4.140.0070.03811.85
5.4.130.0100.03711.84
5.4.120.0050.02811.82
5.4.110.0080.03311.82
5.4.100.0040.02611.82
5.4.90.0080.02411.82
5.4.80.0050.02711.82
5.4.70.0060.02111.82
5.4.60.0090.02011.82
5.4.50.0080.02911.82
5.4.40.0070.02711.81
5.4.30.0050.02711.81
5.4.20.0050.02911.81
5.4.10.0060.02711.81
5.4.00.0040.03011.55
5.3.290.0070.02412.22
5.3.280.0060.03112.18
5.3.270.0070.03212.19
5.3.260.0080.04912.18
5.3.250.0070.03212.18
5.3.240.0070.04712.18
5.3.230.0120.04112.18
5.3.220.0120.04112.16
5.3.210.0080.03912.16
5.3.200.0190.03012.16
5.3.190.0120.04612.16
5.3.180.0120.02912.16
5.3.170.0080.03212.16
5.3.160.0050.03412.16
5.3.150.0070.04312.16
5.3.140.0090.02812.15
5.3.130.0050.03512.15
5.3.120.0060.03212.15
5.3.110.0060.03012.15
5.3.100.0070.02411.88
5.3.90.0090.02911.86
5.3.80.0050.03111.86
5.3.70.0180.03111.86
5.3.60.0120.03311.85
5.3.50.0170.03911.82
5.3.40.0100.03011.83
5.3.30.0090.02511.80
5.3.20.0070.02111.69
5.3.10.0080.01911.67
5.3.00.0080.02111.67
5.2.170.0060.0369.19
5.2.160.0070.0349.19
5.2.150.0080.0329.19
5.2.140.0080.0339.19
5.2.130.0090.0349.14
5.2.120.0230.0719.14
5.2.110.0080.0449.15
5.2.100.0120.0569.15
5.2.90.0090.0619.16
5.2.80.0080.0609.14
5.2.70.0150.0609.14
5.2.60.0200.0609.11
5.2.50.0170.0719.07
5.2.40.0090.0389.04
5.2.30.0100.0499.02
5.2.20.0080.0459.01
5.2.10.0170.0418.92
5.2.00.0110.0468.79
5.1.60.0130.0818.07
5.1.50.0060.0358.07
5.1.40.0280.0698.06
5.1.30.0130.0528.40
5.1.20.0130.0658.43
5.1.10.0150.0438.16
5.1.00.0120.0618.16
5.0.50.0070.0256.63
5.0.40.0120.0696.49
5.0.30.0080.0866.30
5.0.20.0100.0506.26
5.0.10.0140.0686.25
5.0.00.0100.0736.24
4.4.90.0200.0374.78
4.4.80.0070.0194.76
4.4.70.0200.0464.75
4.4.60.0200.0914.76
4.4.50.0040.0194.77
4.4.40.0150.0444.70
4.4.30.0090.0454.76
4.4.20.0040.0254.84
4.4.10.0020.0284.85
4.4.00.0060.0344.76
4.3.110.0040.0224.67
4.3.100.0080.0534.66
4.3.90.0050.0234.64
4.3.80.0030.0364.59
4.3.70.0060.0194.63
4.3.60.0090.0314.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0040.0193.30
4.3.20.0070.0353.28
4.3.10.0170.0413.24
4.3.00.0130.01310.30

preferences:
34.84 ms | 400 KiB | 5 Q