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); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = array(); unset($array); $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array == []); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = array(); unset($array); $i = 0; /* 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.2.00.0070.00719.46
7.1.70.0000.01016.88
7.1.60.0140.01019.39
7.1.50.0060.00617.03
7.1.00.0070.07322.21
7.0.200.0000.00716.96
7.0.140.0030.07722.07
7.0.100.0070.06719.91
7.0.90.0070.07719.86
7.0.80.0230.07719.89
7.0.70.0070.08719.98
7.0.60.0030.08319.98
7.0.50.0030.05020.39
7.0.40.0100.07320.08
7.0.30.0170.05320.19
7.0.20.0130.07720.15
7.0.10.0030.07320.05
7.0.00.0100.04720.07
5.6.280.0130.06721.08
5.6.250.0130.07720.63
5.6.240.0130.08020.67
5.6.230.0170.06020.58
5.6.220.0200.06720.50
5.6.210.0070.06020.67
5.6.200.0030.09020.95
5.6.190.0130.07020.96
5.6.180.0070.05721.02
5.6.170.0070.05721.17
5.6.160.0070.08020.94
5.6.150.0070.10021.02
5.6.140.0130.08021.01
5.6.130.0070.07720.96
5.6.120.0100.04721.05
5.6.110.0130.04321.12
5.6.100.0070.08021.09
5.6.90.0130.08021.16
5.6.80.0130.06320.45
5.6.70.0130.07020.45
5.6.60.0030.04720.55
5.6.50.0100.04720.41
5.6.40.0030.04720.32
5.6.30.0070.07020.54
5.6.20.0130.03320.29
5.6.10.0170.07720.45
5.6.00.0170.04720.52
5.5.380.0100.04020.36
5.5.370.0100.06020.49
5.5.360.0070.06320.42
5.5.350.0030.05720.46
5.5.340.0100.05720.90
5.5.330.0170.03720.80
5.5.320.0170.07720.84
5.5.310.0070.08020.88
5.5.300.0170.05320.93
5.5.290.0130.06720.89
5.5.280.0170.06720.86
5.5.270.0100.07320.95
5.5.260.0100.05720.98
5.5.250.0030.08720.69
5.5.240.0100.07720.22
5.5.230.0130.07020.19
5.5.220.0170.05020.27
5.5.210.0070.08320.11
5.5.200.0030.04720.20
5.5.190.0100.07320.28
5.5.180.0130.05020.24
5.5.160.0170.04720.33
5.5.150.0100.08320.24
5.5.140.0130.07320.14
5.5.130.0200.04720.21
5.5.120.0030.05720.29
5.5.110.0070.03720.18
5.5.100.0230.04320.25
5.5.90.0170.06020.08
5.5.80.0000.04720.13
5.5.70.0070.03720.15
5.5.60.0100.03320.09
5.5.50.0100.03320.09
5.5.40.0100.05720.13
5.5.30.0100.07320.13
5.5.20.0170.05020.21
5.5.10.0100.03320.04
5.5.00.0070.03720.07
5.4.450.0170.06019.29
5.4.440.0170.04719.18
5.4.430.0130.04719.18
5.4.420.0070.05719.43
5.4.410.0030.06319.25
5.4.400.0100.07318.84
5.4.390.0070.05719.06
5.4.380.0100.05319.06
5.4.370.0070.07718.96
5.4.360.0170.05019.11
5.4.350.0170.06719.06
5.4.340.0070.07318.98
5.4.320.0100.07319.05
5.4.310.0070.08718.95
5.4.300.0100.05019.07
5.4.290.0100.05018.82
5.4.280.0000.04318.84
5.4.270.0200.05719.05
5.4.260.0100.05019.03
5.4.250.0070.08018.88
5.4.240.0030.03718.88
5.4.230.0000.06018.95
5.4.220.0030.04018.96
5.4.210.0170.04719.07
5.4.200.0000.03318.82
5.4.190.0070.03718.83
5.4.180.0130.04719.09
5.4.170.0000.04718.96
5.4.160.0100.05019.03
5.4.150.0130.05718.88
5.4.140.0030.03716.35
5.4.130.0130.04016.55
5.4.120.0100.04716.45
5.4.110.0100.04716.42
5.4.100.0070.03716.38
5.4.90.0070.03716.53
5.4.80.0030.05016.50
5.4.70.0130.04316.58
5.4.60.0000.04316.29
5.4.50.0070.03716.29
5.4.40.0070.05016.45
5.4.30.0070.05016.36
5.4.20.0030.05016.46
5.4.10.0000.03316.38
5.4.00.0100.04715.79
5.3.290.0030.04714.60
5.3.280.0030.03714.60
5.3.270.0070.03314.67
5.3.260.0030.03714.73
5.3.250.0000.04014.68
5.3.240.0000.04014.75
5.3.230.0030.03314.72
5.3.220.0070.03314.63
5.3.210.0030.04014.54
5.3.200.0030.04014.71
5.3.190.0030.03714.66
5.3.180.0070.03314.59
5.3.170.0030.03014.49
5.3.160.0000.03314.55
5.3.150.0030.03714.61
5.3.140.0070.02714.61
5.3.130.0070.04014.55
5.3.120.0000.04314.52
5.3.110.0070.03014.66
5.3.100.0070.03314.00
5.3.90.0000.04013.95
5.3.80.0070.03314.13
5.3.70.0000.04013.95
5.3.60.0030.03014.11
5.3.50.0030.03314.06
5.3.40.0030.03713.87
5.3.30.0000.04314.07
5.3.20.0070.03313.73
5.3.10.0070.02713.80
5.3.00.0030.05313.65
5.2.170.0000.03312.21
5.2.160.0030.02312.21
5.2.150.0070.02312.21
5.2.140.0000.02712.21
5.2.130.0000.03012.21
5.2.120.0030.03012.21
5.2.110.0070.02012.21
5.2.100.0030.02712.21
5.2.90.0000.03012.21
5.2.80.0000.02712.21
5.2.70.0030.02712.21
5.2.60.0070.02312.21
5.2.50.0030.04712.21
5.2.40.0030.02012.21
5.2.30.0070.02312.21
5.2.20.0000.06312.21
5.2.10.0030.06312.21
5.2.00.0100.03012.21
5.1.60.0030.05312.21
5.1.50.0030.03012.21
5.1.40.0070.03712.21
5.1.30.0030.06012.21
5.1.20.0000.02712.21
5.1.10.0070.04712.21
5.1.00.0000.05312.21
5.0.50.0000.04712.21
5.0.40.0030.04312.21
5.0.30.0070.06312.21
5.0.20.0000.04712.21
5.0.10.0070.04012.21
5.0.00.0030.06012.21
4.4.90.0030.01312.21
4.4.80.0000.03712.21
4.4.70.0000.01712.21
4.4.60.0000.03312.21
4.4.50.0030.03312.21
4.4.40.0100.04312.21
4.4.30.0030.03312.21
4.4.20.0100.02712.21
4.4.10.0030.03312.21
4.4.00.0000.05712.21
4.3.110.0000.03312.21
4.3.100.0100.02312.21
4.3.90.0030.03312.21
4.3.80.0030.05012.21
4.3.70.0000.01712.21
4.3.60.0070.03012.21
4.3.50.0000.03012.21
4.3.40.0000.05312.21
4.3.30.0030.01312.21
4.3.20.0030.01712.21
4.3.10.0000.02012.21
4.3.00.0000.02012.21

preferences:
34.48 ms | 400 KiB | 5 Q