3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 2 => 'string2', 4 => 'string3', 5 => 'string4'); $arrays =$array; print_r($array); $array=array(); $i=0; 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.4.10.0090.00017.53
8.3.140.0120.00620.70
8.3.130.0090.00918.44
8.3.120.0120.00320.91
8.3.110.0030.00620.94
8.3.100.0040.00724.06
8.3.90.0130.00626.77
8.3.80.0040.00718.55
8.3.70.0120.00918.38
8.3.60.0140.00016.63
8.3.50.0090.00721.92
8.3.40.0100.00318.71
8.3.30.0070.00719.10
8.3.20.0040.00420.02
8.3.10.0080.00023.67
8.3.00.0040.00419.66
8.2.250.0040.01118.47
8.2.240.0060.00317.22
8.2.230.0160.00022.58
8.2.220.0000.00937.54
8.2.210.0140.00026.77
8.2.200.0030.00918.31
8.2.190.0120.00316.58
8.2.180.0120.00325.92
8.2.170.0120.00918.96
8.2.160.0030.01022.96
8.2.150.0080.00024.18
8.2.140.0120.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.83
8.2.110.0070.00322.25
8.2.100.0090.00318.52
8.2.90.0000.00718.34
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0000.00817.91
8.2.50.0040.00418.10
8.2.40.0000.00822.11
8.2.30.0090.00019.38
8.2.20.0040.00417.71
8.2.10.0000.00718.10
8.2.00.0050.00319.46
8.1.300.0030.00617.74
8.1.290.0040.00430.84
8.1.280.0070.00725.92
8.1.270.0060.00323.84
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0060.00620.89
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0000.00817.35
8.1.190.0080.00017.22
8.1.180.0040.00418.10
8.1.170.0050.00518.34
8.1.160.0000.00718.97
8.1.150.0000.00718.89
8.1.140.0050.00217.45
8.1.130.0000.00817.39
8.1.120.0000.00717.32
8.1.110.0040.00417.47
8.1.100.0030.00417.39
8.1.90.0000.00717.39
8.1.80.0080.00017.46
8.1.70.0000.00817.40
8.1.60.0000.00817.54
8.1.50.0040.00417.55
8.1.40.0000.00717.52
8.1.30.0000.00817.67
8.1.20.0000.00717.64
8.1.10.0120.00417.45
8.1.00.0120.00417.40
8.0.300.0070.00020.14
8.0.290.0020.00516.63
8.0.280.0000.00718.45
8.0.270.0050.00317.18
8.0.260.0080.00016.82
8.0.250.0070.00016.87
8.0.240.0030.00316.98
8.0.230.0030.00516.79
8.0.220.0030.00316.78
8.0.210.0070.00016.85
8.0.200.0050.00216.96
8.0.190.0030.00316.98
8.0.180.0070.00016.82
8.0.170.0040.00416.92
8.0.160.0000.00816.90
8.0.150.0080.00016.80
8.0.140.0100.00316.84
8.0.130.0100.00415.63
8.0.120.0070.00816.85
8.0.110.0070.00416.82
8.0.100.0080.00616.86
8.0.90.0060.00616.86
8.0.80.0090.00516.86
8.0.70.0100.00316.81
8.0.60.0090.00516.80
8.0.50.0060.00616.80
8.0.30.0060.01116.87
8.0.20.0100.00517.03
8.0.10.0060.00817.02
8.0.00.0060.01017.08
7.4.330.0050.00213.72
7.4.320.0030.00316.46
7.4.300.0040.00416.61
7.4.290.0040.00416.48
7.4.280.0040.00416.61
7.4.270.0150.00016.49
7.4.260.0150.00416.48
7.4.250.0170.00216.47
7.4.240.0100.00616.57
7.4.230.0170.00316.50
7.4.220.0120.00616.55
7.4.210.0110.00516.51
7.4.200.0100.00616.43
7.4.190.0130.00216.61
7.4.180.0140.00116.61
7.4.160.0100.00616.51
7.4.150.0080.00816.65
7.4.140.0080.01016.96
7.4.130.0080.00916.62
7.4.120.0060.01116.63
7.4.110.0100.00816.67
7.4.100.0100.00716.67
7.4.90.0090.00616.57
7.4.80.0110.00616.96
7.4.70.0100.00716.64
7.4.60.0110.00616.56
7.4.50.0100.00516.58
7.4.40.0090.00716.56
7.4.30.0090.00816.59
7.4.20.0090.00716.59
7.4.10.0100.00716.46
7.4.00.0090.00616.26
7.3.330.0090.00415.24
7.3.320.0120.00415.24
7.3.310.0150.00216.24
7.3.300.0160.00116.28
7.3.290.0100.00716.31
7.3.280.0130.00416.31
7.3.270.0110.00516.52
7.3.260.0090.00816.55
7.3.250.0100.00716.52
7.3.240.0090.00716.50
7.3.230.0110.00516.52
7.3.220.0110.00416.44
7.3.210.0080.00816.49
7.3.200.0080.00816.85
7.3.190.0090.00616.52
7.3.180.0080.00816.48
7.3.170.0060.01016.50
7.3.160.0090.00716.48
7.3.150.0080.00816.48
7.3.140.0090.00716.54
7.3.130.0110.00616.26
7.3.120.0080.00816.06
7.3.110.0090.00816.08
7.3.100.0100.00615.86
7.3.90.0090.00716.11
7.3.80.0100.00615.95
7.3.70.0080.00815.80
7.3.60.0090.00715.72
7.3.50.0070.00815.60
7.3.40.0080.00715.56
7.3.30.0090.00615.58
7.3.20.0110.00616.21
7.3.10.0120.00716.28
7.3.00.0100.00816.26
7.2.340.0150.00716.63
7.2.330.0140.00816.58
7.2.320.0130.00916.63
7.2.310.0150.00916.64
7.2.300.0140.00916.58
7.2.290.0140.00916.56
7.2.280.0130.00916.60
7.2.270.0150.00716.58
7.2.260.0150.00816.33
7.2.250.0150.00716.44
7.2.240.0130.00816.23
7.2.230.0140.00716.12
7.2.220.0110.01016.12
7.2.210.0130.00916.05
7.2.200.0140.00815.98
7.2.190.0130.00815.75
7.2.180.0120.00815.65
7.2.170.0090.00915.70
7.2.160.0120.00715.66
7.2.150.0120.00716.44
7.2.140.0120.00616.40
7.2.130.0120.00916.47
7.2.120.0130.00816.42
7.2.110.0130.00716.45
7.2.100.0190.00716.50
7.2.90.0120.00816.44
7.2.80.0120.00816.42
7.2.70.0130.00816.42
7.2.60.0120.00816.42
7.2.50.0130.00816.40
7.2.40.0350.00716.58
7.2.30.0300.00716.58
7.2.20.0300.00816.55
7.2.10.0310.00916.53
7.2.00.0290.00716.69
7.1.330.0280.00616.12
7.1.320.0140.00815.90
7.1.310.0140.00715.78
7.1.300.0140.00715.70
7.1.290.0130.00615.63
7.1.280.0140.00715.47
7.1.270.0120.00815.41
7.1.260.0120.00715.45
7.1.250.0110.00715.40
7.1.240.0190.00615.37
7.1.230.0130.00815.41
7.1.220.0140.00815.43
7.1.210.0140.00615.42
7.1.200.0130.00815.48
7.1.190.0160.01015.45
7.1.180.0200.00715.43
7.1.170.0130.00815.45
7.1.160.0350.00815.55
7.1.150.0310.00915.50
7.1.140.0310.00715.50
7.1.130.0310.00815.47
7.1.120.0310.00715.56
7.1.110.0260.00715.52
7.1.100.0280.00715.60
7.1.90.0380.00915.58
7.1.80.0290.00715.55
7.1.70.0240.00815.63
7.1.60.0240.00817.50
7.1.50.0240.00717.49
7.1.40.0240.01017.51
7.1.30.0220.00617.39
7.1.20.0210.00717.37
7.1.10.0180.00815.52
7.1.00.0160.00815.59
7.0.330.0140.00715.07
7.0.320.0130.00815.10
7.0.310.0150.00615.08
7.0.300.0130.00815.12
7.0.290.0320.00815.19
7.0.280.0160.00615.08
7.0.270.0340.00815.14
7.0.260.0350.00715.18
7.0.250.0300.00715.25
7.0.240.0230.00815.26
7.0.230.0460.00715.22
7.0.220.0340.00815.35
7.0.210.0270.00715.21
7.0.200.0260.00615.24
7.0.190.0250.00615.30
7.0.180.0230.00715.21
7.0.170.0190.00915.24
7.0.160.0220.00715.19
7.0.150.0240.00915.17
7.0.140.0200.00715.27
7.0.130.0190.00815.26
7.0.120.0170.00815.31
7.0.110.0180.00815.13
7.0.100.0190.00615.18
7.0.90.0170.00815.22
7.0.80.0200.00715.19
7.0.70.0220.00715.19
7.0.60.0220.00715.18
7.0.50.0190.00615.22
7.0.40.0230.00615.23
7.0.30.0190.00615.25
7.0.20.0260.00715.24
7.0.10.0250.00615.21
7.0.00.0220.00515.16
5.6.400.0150.00715.22
5.6.390.0120.00915.19
5.6.380.0150.00715.18
5.6.370.0150.00815.20
5.6.360.0150.00615.21
5.6.350.0150.00915.31
5.6.340.0150.00815.23
5.6.330.0160.00915.27
5.6.320.0160.00815.24
5.6.310.0150.00815.17
5.6.300.0140.01616.09
5.6.290.0150.01516.15
5.6.280.0130.01916.13
5.6.270.0150.01516.15
5.6.260.0150.01516.14
5.6.250.0150.01716.13
5.6.240.0130.01716.15
5.6.230.0170.01416.17
5.6.220.0150.01616.17
5.6.210.0150.01616.13
5.6.200.0170.01616.18
5.6.190.0150.01616.20
5.6.180.0130.01816.14
5.6.170.0150.01816.21
5.6.160.0140.01716.21
5.6.150.0130.01616.18
5.6.140.0130.01916.18
5.6.130.0150.01816.21
5.6.120.0150.01516.15
5.6.110.0150.01716.12
5.6.100.0150.01616.20
5.6.90.0130.01816.14
5.6.80.0120.01615.93
5.6.70.0130.01515.98
5.6.60.0150.01516.01
5.6.50.0140.01615.96
5.6.40.0150.01616.00
5.6.30.0140.01615.94
5.6.20.0140.01616.00
5.6.10.0160.01515.96
5.6.00.0140.01615.95
5.5.380.0130.01515.55
5.5.370.0130.01715.62
5.5.360.0140.01715.51
5.5.350.0160.01615.48
5.5.340.0140.01515.63
5.5.330.0150.01515.55
5.5.320.0130.01715.56
5.5.310.0150.01815.61
5.5.300.0130.01615.68
5.5.290.0160.01715.65
5.5.280.0140.01515.58
5.5.270.0140.01615.57
5.5.260.0150.01515.62
5.5.250.0170.01415.54
5.5.240.0130.01615.53
5.5.230.0120.01515.50
5.5.220.0120.01515.56
5.5.210.0160.01315.48
5.5.200.0130.01515.41
5.5.190.0130.01515.46
5.5.180.0130.01515.47
5.5.170.0140.00915.09
5.5.160.0130.01515.43
5.5.150.0130.01415.43
5.5.140.0130.01515.44
5.5.130.0140.01515.38
5.5.120.0120.01715.37
5.5.110.0130.01515.40
5.5.100.0130.01715.41
5.5.90.0130.01515.41
5.5.80.0140.01415.45
5.5.70.0160.01315.45
5.5.60.0130.01815.39
5.5.50.0140.01615.37
5.5.40.0140.01515.44
5.5.30.0130.01615.41
5.5.20.0120.01815.44
5.5.10.0140.01715.41
5.5.00.0140.01615.40
5.4.450.0110.01513.58
5.4.440.0120.01213.62
5.4.430.0120.01213.50
5.4.420.0120.01613.58
5.4.410.0110.01513.55
5.4.400.0120.01213.46
5.4.390.0120.01213.43
5.4.380.0110.01613.44
5.4.370.0100.01413.46
5.4.360.0120.01313.41
5.4.350.0120.01213.48
5.4.340.0120.01413.45
5.4.330.0130.00412.42
5.4.320.0100.01413.53
5.4.310.0110.01213.42
5.4.300.0100.01413.47
5.4.290.0100.01413.44
5.4.280.0110.01313.40
5.4.270.0120.01113.50
5.4.260.0120.01213.42
5.4.250.0090.01513.50
5.4.240.0120.01213.42
5.4.230.0120.01313.34
5.4.220.0110.01513.38
5.4.210.0120.01213.39
5.4.200.0110.01413.44
5.4.190.0120.01413.38
5.4.180.0120.01313.38
5.4.170.0110.01513.40
5.4.160.0110.01313.40
5.4.150.0110.01413.44
5.4.140.0100.01313.06
5.4.130.0110.01413.09
5.4.120.0120.01213.05
5.4.110.0120.01413.13
5.4.100.0110.01313.13
5.4.90.0100.01313.12
5.4.80.0090.01513.14
5.4.70.0100.01313.08
5.4.60.0100.01313.12
5.4.50.0110.01213.11
5.4.40.0110.01213.13
5.4.30.0110.01213.08
5.4.20.0100.01413.12
5.4.10.0100.01313.11
5.4.00.0090.01312.91
5.3.290.0120.01312.76
5.3.280.0100.01212.65
5.3.270.0120.01112.71
5.3.260.0110.01312.76
5.3.250.0110.01512.74
5.3.240.0100.01412.65
5.3.230.0120.01212.65
5.3.220.0110.01312.64
5.3.210.0110.01412.66
5.3.200.0100.01212.67
5.3.190.0100.01412.70
5.3.180.0120.01312.80
5.3.170.0100.01412.79
5.3.160.0110.01112.77
5.3.150.0110.01212.78
5.3.140.0110.01212.77
5.3.130.0100.01512.72
5.3.120.0120.01312.72
5.3.110.0100.01412.72
5.3.100.0090.01512.68
5.3.90.0100.01312.69
5.3.80.0100.01312.61
5.3.70.0110.01312.61
5.3.60.0090.01312.56
5.3.50.0100.01212.61
5.3.40.0110.01212.62
5.3.30.0100.01212.65
5.3.20.0090.01412.50
5.3.10.0110.01512.47
5.3.00.0100.01412.40

preferences:
54.38 ms | 403 KiB | 5 Q