3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 2 => 'string5', 4 => 'string3', 5 => 'string4'); $arrays =$array; print_r($array); $array=array(); $i=1; foreach($arrays as $k => $item) { $array[$i]=$item; unset($arrays[$k]); $i++; } print_r($array);

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)
8.3.60.0140.00416.61
8.3.50.0090.00922.01
8.3.40.0110.00718.43
8.3.30.0070.00718.92
8.3.20.0070.00019.93
8.3.10.0090.00023.65
8.3.00.0040.00422.40
8.2.180.0090.00616.50
8.2.170.0110.00322.96
8.2.160.0100.00620.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0110.00726.16
8.2.120.0040.00422.26
8.2.110.0000.00922.00
8.2.100.0120.00017.91
8.2.90.0040.00419.07
8.2.80.0030.00518.05
8.2.70.0060.00317.63
8.2.60.0050.00317.93
8.2.50.0060.00318.07
8.2.40.0080.00018.16
8.2.30.0040.00418.06
8.2.20.0030.00517.60
8.2.10.0000.00819.61
8.2.00.0080.00017.63
8.1.280.0070.01025.92
8.1.270.0040.00421.92
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0090.00023.79
8.1.230.0080.00319.08
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0060.00317.48
8.1.190.0080.00017.53
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0000.00722.06
8.1.150.0000.00718.58
8.1.140.0040.00417.50
8.1.130.0030.00517.73
8.1.120.0070.00017.46
8.1.110.0040.00417.41
8.1.100.0040.00417.32
8.1.90.0000.00717.49
8.1.80.0040.00417.49
8.1.70.0040.00417.37
8.1.60.0000.00817.61
8.1.50.0030.00517.51
8.1.40.0030.00617.50
8.1.30.0000.00817.62
8.1.20.0000.00717.58
8.1.10.0040.00417.57
8.1.00.0050.00217.45
8.0.300.0060.00318.77
8.0.290.0000.00717.18
8.0.280.0040.00418.45
8.0.270.0040.00417.26
8.0.260.0070.00016.67
8.0.250.0000.00616.99
8.0.240.0060.00317.00
8.0.230.0000.00716.84
8.0.220.0030.00316.87
8.0.210.0060.00016.85
8.0.200.0040.00416.89
8.0.190.0040.00317.04
8.0.180.0040.00416.96
8.0.170.0000.00716.90
8.0.160.0000.00816.84
8.0.150.0000.00716.83
8.0.140.0050.00316.82
8.0.130.0030.00313.32
8.0.120.0040.00416.87
8.0.110.0040.00416.89
8.0.100.0000.00716.92
8.0.90.0030.00316.90
8.0.80.0060.01416.86
8.0.70.0050.00216.77
8.0.60.0000.00716.79
8.0.50.0050.00216.89
8.0.30.0120.00716.96
8.0.20.0100.00817.40
8.0.10.0030.00516.89
8.0.00.0150.00816.79
7.4.330.0000.00515.00
7.4.320.0060.00016.63
7.4.300.0040.00416.51
7.4.290.0000.00716.49
7.4.280.0050.00316.47
7.4.270.0030.00316.62
7.4.260.0030.00516.40
7.4.250.0000.00716.32
7.4.240.0040.00316.51
7.4.230.0000.00716.59
7.4.220.0110.00616.48
7.4.210.0090.00816.59
7.4.200.0000.00716.25
7.4.190.0000.00716.63
7.4.160.0060.01016.54
7.4.150.0040.01317.40
7.4.140.0110.00817.86
7.4.130.0120.00516.52
7.4.120.0110.01016.50
7.4.110.0070.01016.56
7.4.100.0110.00916.40
7.4.90.0030.01316.39
7.4.80.0100.01019.39
7.4.70.0190.00016.57
7.4.60.0100.00616.48
7.4.50.0000.00516.30
7.4.40.0070.01022.77
7.4.30.0100.00616.56
7.4.00.0100.00614.78
7.3.330.0000.00613.04
7.3.320.0030.00313.18
7.3.310.0030.00316.18
7.3.300.0070.00016.36
7.3.290.0120.00616.33
7.3.280.0040.01116.35
7.3.270.0110.00717.40
7.3.260.0110.01116.32
7.3.250.0100.00716.43
7.3.240.0060.01216.29
7.3.230.0090.00616.39
7.3.210.0130.00416.49
7.3.200.0100.01319.39
7.3.190.0180.00316.27
7.3.180.0090.00816.18
7.3.170.0070.00716.31
7.3.160.0060.00916.48
7.3.120.0090.00814.92
7.3.110.0050.01014.87
7.3.100.0040.01014.84
7.3.90.0040.01014.84
7.3.80.0090.00514.89
7.3.70.0070.00514.81
7.3.60.0050.00814.78
7.3.50.0060.00914.73
7.3.40.0070.00914.84
7.3.30.0070.00614.81
7.3.20.0050.00916.68
7.3.10.0040.00916.63
7.3.00.0080.00716.71
7.2.330.0140.00416.52
7.2.320.0070.01016.66
7.2.310.0030.02016.42
7.2.300.0120.00616.70
7.2.290.0100.00716.57
7.2.250.0050.01315.17
7.2.240.0030.01114.89
7.2.230.0060.00714.90
7.2.220.0030.01014.87
7.2.210.0030.01115.00
7.2.200.0070.00914.88
7.2.190.0070.00814.97
7.2.180.0070.00614.95
7.2.170.0030.01014.99
7.2.160.0070.00714.88
7.2.150.0050.01216.68
7.2.140.0110.00316.92
7.2.130.0060.00816.81
7.2.120.0080.00816.87
7.2.110.0080.00516.68
7.2.100.0070.00916.96
7.2.90.0080.00816.98
7.2.80.0050.00816.90
7.2.70.0050.00916.87
7.2.60.0040.00716.87
7.2.50.0070.00816.72
7.2.40.0080.00816.79
7.2.30.0090.00517.04
7.2.20.0070.01016.86
7.2.10.0060.01016.79
7.2.00.0050.01017.63
7.1.330.0090.00515.79
7.1.320.0080.00615.77
7.1.310.0070.00715.88
7.1.300.0080.00615.81
7.1.290.0070.00615.61
7.1.280.0040.00715.81
7.1.270.0040.01115.90
7.1.260.0060.00815.92
7.1.250.0030.01215.68
7.1.100.0000.01318.09
7.1.70.0040.00417.17
7.1.60.0120.00619.29
7.1.50.0070.01316.99
7.1.00.0000.07722.32
7.0.200.0040.01416.95
7.0.140.0030.07322.04
7.0.60.0000.08720.07
7.0.50.0130.04317.89
7.0.40.0130.05320.30
7.0.30.0330.08020.07
7.0.20.0230.06720.09
7.0.10.0130.05020.21
7.0.00.0200.06720.22
5.6.280.0100.06320.86
5.6.210.0170.06720.46
5.6.200.0170.04018.23
5.6.190.0030.04320.49
5.6.180.0070.08320.47
5.6.170.0370.07020.55
5.6.160.0070.08720.41
5.6.150.0030.05018.16
5.6.140.0170.04318.16
5.6.130.0070.04718.23
5.6.120.0030.04320.99
5.6.110.0170.06021.13
5.6.100.0070.08321.10
5.6.90.0100.07321.01
5.6.80.0030.04320.53
5.6.70.0330.04020.27
5.5.350.0170.07320.49
5.5.340.0070.08017.99
5.5.330.0130.05320.25
5.5.320.0070.04320.30
5.5.310.0330.07320.29
5.5.300.0070.03318.01
5.5.290.0070.04018.04
5.5.280.0100.04020.87
5.5.270.0100.04020.76
5.5.260.0030.09320.86
5.5.250.0230.06720.46
5.5.240.0170.07020.06
5.4.450.0030.04319.41
5.4.440.0070.07719.41
5.4.430.0000.06319.38
5.4.420.0030.04319.41
5.4.410.0070.07019.14
5.4.400.0070.07319.25
5.4.390.0000.08019.22
5.4.380.0070.05018.87
5.4.370.0030.06318.98
5.4.360.0100.07319.31
5.4.350.0070.07319.09
5.4.340.0100.06319.24
5.4.320.0100.04318.85
5.4.310.0130.03319.21
5.4.300.0070.06718.84
5.4.290.0030.05018.98
5.4.280.0100.07019.13
5.4.270.0000.08018.86
5.4.260.0070.07719.24
5.4.250.0030.07319.12
5.4.240.0030.08018.88
5.4.230.0030.06718.84
5.4.220.0070.07718.84
5.4.210.0030.08019.30
5.4.200.0070.07019.23
5.4.190.0070.05019.21
5.4.180.0070.07318.88
5.4.170.0000.07018.98
5.4.160.0030.06018.95
5.4.150.0070.07719.06
5.4.140.0000.07016.29
5.4.130.0070.05316.32
5.4.120.0100.06316.49
5.4.110.0030.07016.35
5.4.100.0070.05716.35
5.4.90.0100.07016.55
5.4.80.0000.07716.56
5.4.70.0070.05016.43
5.4.60.0030.07316.51
5.4.50.0000.08016.51
5.4.40.0030.05016.21
5.4.30.0000.04716.48
5.4.20.0130.05016.48
5.4.10.0030.07716.19
5.4.00.0100.06015.91
5.3.290.0030.04714.68
5.3.280.0070.06014.70
5.3.270.0030.07714.64
5.3.260.0030.06314.68
5.3.250.0000.07714.68
5.3.240.0030.06014.61
5.3.230.0000.07714.50
5.3.220.0000.07314.47
5.3.210.0070.07314.58
5.3.200.0070.07014.61
5.3.190.0000.07714.56
5.3.180.0030.07314.48
5.3.170.0030.07014.43
5.3.160.0030.07314.77
5.3.150.0070.07014.71
5.3.140.0030.06314.45
5.3.130.0000.07314.59
5.3.120.0030.05314.61
5.3.110.0000.07714.55
5.3.100.0100.06014.11
5.3.90.0070.06714.23
5.3.80.0030.07014.06
5.3.70.0000.07713.92
5.3.60.0000.08014.00
5.3.50.0030.06313.98
5.3.40.0070.06014.02
5.3.30.0030.07013.98
5.3.20.0070.06013.78
5.3.10.0030.05313.87
5.3.00.0070.05313.54
5.2.170.0000.06312.68
5.2.160.0030.06012.68
5.2.150.0030.06312.68
5.2.140.0000.05312.68
5.2.130.0030.06012.68
5.2.120.0030.04712.68
5.2.110.0000.06312.68
5.2.100.0000.06312.68
5.2.90.0000.06312.68
5.2.80.0030.06712.68
5.2.70.0030.05712.68
5.2.60.0070.03312.68
5.2.50.0030.05712.68
5.2.40.0000.05712.68
5.2.30.0000.05012.68
5.2.20.0030.04312.68
5.2.10.0000.06012.68
5.2.00.0170.04712.68
5.1.60.0070.04712.68
5.1.50.0100.04012.68
5.1.40.0100.04712.68
5.1.30.0000.05712.68
5.1.20.0030.04312.68
5.1.10.0000.06312.68
5.1.00.0030.04312.68
5.0.50.0000.04312.68
5.0.40.0030.04012.68
5.0.30.0000.05712.68
5.0.20.0030.03712.68
5.0.10.0030.03012.68
5.0.00.0030.06312.68
4.4.90.0000.02312.68
4.4.80.0030.02712.68
4.4.70.0000.03712.68
4.4.60.0000.03712.68
4.4.50.0000.03712.68
4.4.40.0030.05012.68
4.4.30.0000.02712.68
4.4.20.0000.03012.68
4.4.10.0030.03712.68
4.4.00.0030.05712.68
4.3.110.0000.03712.68
4.3.100.0030.03312.68
4.3.90.0000.03012.68
4.3.80.0030.03312.68
4.3.70.0000.01712.68
4.3.60.0030.02312.68
4.3.50.0070.02712.68
4.3.40.0000.03312.68
4.3.30.0000.02012.68
4.3.20.0000.03712.68
4.3.10.0000.02312.68
4.3.00.0000.03012.68

preferences:
48.35 ms | 400 KiB | 5 Q