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=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.0100.00716.75
8.3.50.0090.00922.11
8.3.40.0060.01218.84
8.3.30.0140.00018.95
8.3.20.0050.00320.33
8.3.10.0000.00723.53
8.3.00.0080.00019.15
8.2.180.0130.00918.16
8.2.170.0130.00722.96
8.2.160.0030.01022.25
8.2.150.0090.00024.18
8.2.140.0090.00024.66
8.2.130.0020.00526.16
8.2.120.0080.00021.04
8.2.110.0090.00022.29
8.2.100.0110.00018.03
8.2.90.0030.00617.88
8.2.80.0080.00018.82
8.2.70.0000.00818.04
8.2.60.0040.00418.16
8.2.50.0040.00419.46
8.2.40.0040.00421.05
8.2.30.0080.00318.44
8.2.20.0040.00418.56
8.2.10.0070.00517.89
8.2.00.0090.00417.76
8.1.280.0080.00625.92
8.1.270.0080.00019.01
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.58
8.1.230.0080.00320.85
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0000.00819.04
8.1.170.0050.00318.49
8.1.160.0050.00418.15
8.1.150.0100.00218.17
8.1.140.0100.00217.44
8.1.130.0040.00717.62
8.1.120.0090.00417.47
8.1.110.0060.00617.47
8.1.100.0070.00517.46
8.1.90.0070.00417.45
8.1.80.0080.00517.44
8.1.70.0110.00017.44
8.1.60.0080.00617.60
8.1.50.0120.00117.47
8.1.40.0070.00617.59
8.1.30.0090.00517.57
8.1.20.0110.00217.58
8.1.10.0080.00617.42
8.1.00.0090.00617.46
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0090.00217.66
8.0.270.0100.00217.00
8.0.260.0090.00317.01
8.0.250.0070.00116.94
8.0.240.0080.00316.84
8.0.230.0080.00316.90
8.0.220.0100.00116.85
8.0.210.0040.00616.84
8.0.200.0090.00016.85
8.0.190.0050.00616.90
8.0.180.0080.00316.93
8.0.170.0080.00316.84
8.0.160.0030.00716.94
8.0.150.0040.00516.80
8.0.140.0020.00816.76
8.0.130.0040.00415.04
8.0.120.0040.00616.81
8.0.110.0040.00616.82
8.0.100.0050.00616.85
8.0.90.0060.00516.76
8.0.80.0070.00916.89
8.0.70.0100.00616.83
8.0.60.0100.00816.83
8.0.50.0080.00716.85
8.0.30.0090.01016.89
8.0.20.0100.00817.06
8.0.10.0130.00716.96
8.0.00.0110.00716.85
7.4.330.0050.00115.90
7.4.320.0080.00416.57
7.4.300.0090.00316.67
7.4.290.0130.00016.55
7.4.280.0080.00416.54
7.4.270.0090.00316.62
7.4.260.0030.00816.60
7.4.250.0040.00816.63
7.4.240.0080.00216.61
7.4.230.0070.00516.61
7.4.220.0120.00316.59
7.4.210.0050.01016.63
7.4.200.0070.01016.60
7.4.190.0100.00616.62
7.4.180.0070.00816.71
7.4.160.0070.00816.59
7.4.150.0100.00816.77
7.4.140.0100.00917.11
7.4.130.0110.00816.49
7.4.120.0080.00916.62
7.4.110.0090.01016.58
7.4.100.0080.01016.57
7.4.90.0110.00716.55
7.4.80.0070.00917.26
7.4.70.0070.00916.48
7.4.60.0110.00616.53
7.4.50.0090.00716.47
7.4.40.0120.00616.44
7.4.30.0090.00616.46
7.4.20.0050.01116.55
7.4.10.0120.00416.56
7.4.00.0080.00916.17
7.3.330.0040.00614.99
7.3.320.0050.00514.98
7.3.310.0070.00316.56
7.3.300.0070.00316.52
7.3.290.0070.00716.46
7.3.280.0080.00716.42
7.3.270.0100.00916.67
7.3.260.0080.01016.51
7.3.250.0130.00516.41
7.3.240.0100.00616.54
7.3.230.0090.01016.48
7.3.220.0090.00616.40
7.3.210.0120.00516.38
7.3.200.0090.00817.17
7.3.190.0090.00616.40
7.3.180.0100.00816.47
7.3.170.0110.00616.39
7.3.160.0100.00716.39
7.3.150.0070.01116.40
7.3.140.0080.01216.39
7.3.130.0080.01016.41
7.3.120.0100.00716.38
7.3.110.0120.00316.37
7.3.100.0070.01116.38
7.3.90.0060.01016.59
7.3.80.0080.01016.40
7.3.70.0150.00316.47
7.3.60.0050.01116.53
7.3.50.0110.00716.56
7.3.40.0140.00316.58
7.3.30.0090.00616.54
7.3.20.0100.00717.04
7.3.10.0080.00716.94
7.3.00.0080.00817.00
7.2.340.0080.01316.49
7.2.330.0170.00416.49
7.2.320.0120.00816.49
7.2.310.0130.00516.51
7.2.300.0180.00916.48
7.2.290.0100.00916.46
7.2.280.0150.00516.47
7.2.270.0080.01016.44
7.2.260.0100.00916.43
7.2.250.0100.01016.49
7.2.240.0100.01016.44
7.2.230.0120.00816.45
7.2.220.0140.00716.47
7.2.210.0120.00716.47
7.2.200.0080.01216.59
7.2.190.0120.00816.53
7.2.180.0100.01016.54
7.2.170.0120.00916.57
7.2.160.0100.00916.56
7.2.150.0180.00317.10
7.2.140.0140.00617.17
7.2.130.0140.01017.27
7.2.120.0130.00817.19
7.2.110.0110.01317.27
7.2.100.0130.01117.18
7.2.90.0340.00817.14
7.2.80.0130.00916.49
7.2.70.0160.00716.73
7.2.60.0120.00916.68
7.2.50.0680.00516.66
7.2.40.0150.00816.60
7.2.30.0630.00516.69
7.2.20.0750.00716.69
7.2.10.0400.00716.61
7.2.00.0130.00717.21
7.1.330.0170.01016.18
7.1.320.0180.00516.23
7.1.310.0240.00516.10
7.1.300.0150.00716.09
7.1.290.0180.00716.09
7.1.280.0120.00916.16
7.1.270.0390.00616.12
7.1.260.0160.00516.13
7.1.250.0130.01016.03
7.1.240.0140.01016.01
7.1.230.0140.00916.11
7.1.220.0160.00716.02
7.1.210.0110.01216.08
7.1.200.0120.00815.54
7.1.190.0130.00815.50
7.1.180.0140.00815.61
7.1.170.0730.00715.61
7.1.160.0180.00615.54
7.1.150.0360.00615.46
7.1.140.0640.00715.54
7.1.130.0170.00615.53
7.1.120.0150.00615.43
7.1.110.0990.01015.59
7.1.100.0150.00816.06
7.1.90.0160.00915.60
7.1.80.0490.01015.55
7.1.70.0300.00715.81
7.1.60.0290.00619.93
7.1.50.0290.00519.39
7.1.40.0310.00720.00
7.1.30.0370.01420.05
7.1.20.0290.00820.04
7.1.10.0330.00515.53
7.1.00.0210.01716.90
7.0.330.0170.00715.81
7.0.320.0160.00515.68
7.0.310.0170.00515.16
7.0.300.0220.01015.19
7.0.290.0450.00815.24
7.0.280.0850.00715.08
7.0.270.0200.00615.16
7.0.260.0320.00315.08
7.0.250.0170.00915.36
7.0.240.0170.00715.35
7.0.230.0520.00915.32
7.0.220.0350.01015.32
7.0.210.0410.00515.38
7.0.200.0400.00815.53
7.0.190.0390.00715.33
7.0.180.0330.00715.22
7.0.170.0380.00615.38
7.0.160.0700.00715.26
7.0.150.0320.00915.27
7.0.140.0250.01116.64
7.0.130.0310.00815.30
7.0.120.0340.00815.27
7.0.110.0370.00715.31
7.0.100.0340.00715.13
7.0.90.0320.00415.21
7.0.80.0300.01216.07
7.0.70.0200.01616.16
7.0.60.0290.02316.12
7.0.50.0300.01516.26
7.0.40.0180.02116.22
7.0.30.0150.02516.17
7.0.20.0150.01716.21
7.0.10.0250.01616.20
7.0.00.0210.01916.20
5.6.400.0170.01016.16
5.6.390.0190.00516.13
5.6.380.0170.00816.07
5.6.370.0180.00516.14
5.6.360.0170.00816.06
5.6.350.0200.00716.09
5.6.340.0150.01016.08
5.6.330.0140.00816.13
5.6.320.0120.01016.07
5.6.310.0180.00616.13
5.6.300.0150.00815.64
5.6.290.0130.01015.67
5.6.280.0120.02216.75
5.6.270.0150.00715.62
5.6.260.0170.00415.76
5.6.250.0170.00615.72
5.6.240.0150.00715.76
5.6.230.0110.02416.75
5.6.220.0140.01516.68
5.6.210.0120.02216.67
5.6.200.0140.01516.87
5.6.190.0150.02116.89
5.6.180.0110.01916.80
5.6.170.0120.01716.88
5.6.160.0140.02216.87
5.6.150.0130.01516.88
5.6.140.0160.02116.89
5.6.130.0150.02216.93
5.6.120.0160.02216.86
5.6.110.0070.02816.83
5.6.100.0130.01716.85
5.6.90.0160.02016.80
5.6.80.0120.02216.61
5.6.70.0130.02116.64
5.6.60.0130.01916.63
5.6.50.0140.02516.57
5.6.40.0140.01316.68
5.6.30.0130.01716.70
5.6.20.0180.01516.66
5.6.10.0120.02216.59
5.6.00.0140.02216.67
5.5.380.0140.00515.01
5.5.370.0110.01816.09
5.5.360.0130.02115.97
5.5.350.0150.02015.93
5.5.340.0130.02116.04
5.5.330.0140.01316.14
5.5.320.0100.01916.04
5.5.310.0140.01716.03
5.5.300.0150.01815.97
5.5.290.0150.01516.07
5.5.280.0150.02116.09
5.5.270.0130.01716.06
5.5.260.0140.01516.11
5.5.250.0140.02216.10
5.5.240.0110.02115.94
5.5.230.0120.02315.99
5.5.220.0150.01415.96
5.5.210.0170.01415.95
5.5.200.0160.01815.88
5.5.190.0100.02215.86
5.5.180.0130.02115.96
5.5.170.0130.00815.64
5.5.160.0110.02215.81
5.5.150.0160.01615.84
5.5.140.0150.01815.84
5.5.130.0090.02315.79
5.5.120.0150.01915.81
5.5.110.0120.01915.92
5.5.100.0130.01215.87
5.5.90.0140.01215.98
5.5.80.0130.02116.00
5.5.70.0120.02116.01
5.5.60.0120.02715.89
5.5.50.0120.01815.91
5.5.40.0120.02215.82
5.5.30.0120.02115.92
5.5.20.0140.02015.88
5.5.10.0120.02115.91
5.5.00.0150.01515.93
5.4.450.0100.02015.03
5.4.440.0110.01815.04
5.4.430.0140.01714.99
5.4.420.0110.02014.94
5.4.410.0090.01314.98
5.4.400.0110.01814.86
5.4.390.0090.01614.84
5.4.380.0120.01514.89
5.4.370.0100.02014.89
5.4.360.0100.02114.92
5.4.350.0110.01914.88
5.4.340.0130.01214.86
5.4.330.0090.00813.83
5.4.320.0110.01914.87
5.4.310.0090.01515.00
5.4.300.0110.01514.91
5.4.290.0100.02114.83
5.4.280.0120.01414.94
5.4.270.0090.01614.88
5.4.260.0180.01914.88
5.4.250.0120.01214.86
5.4.240.0140.01614.88
5.4.230.0090.02414.83
5.4.220.0080.02214.78
5.4.210.0120.01214.90
5.4.200.0110.02214.82
5.4.190.0110.01414.86
5.4.180.0120.01414.85
5.4.170.0120.01914.87
5.4.160.0120.01814.83
5.4.150.0110.01614.85
5.4.140.0100.02014.36
5.4.130.0110.01714.35
5.4.120.0110.01614.37
5.4.110.0120.01814.36
5.4.100.0080.01414.41
5.4.90.0090.01914.36
5.4.80.0110.01814.44
5.4.70.0120.01514.36
5.4.60.0090.02014.45
5.4.50.0140.01314.36
5.4.40.0120.01914.44
5.4.30.0090.02114.42
5.4.20.0110.01514.38
5.4.10.0090.01414.33
5.4.00.0090.02114.21

preferences:
56.41 ms | 401 KiB | 5 Q