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_values($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.3.70.0070.00718.27
8.3.60.0090.00916.63
8.3.50.0090.01122.89
8.3.40.0120.00618.66
8.3.30.0070.00719.09
8.3.20.0070.00020.19
8.3.10.0080.00023.70
8.3.00.0040.00419.13
8.2.180.0150.00616.75
8.2.170.0070.00722.96
8.2.160.0060.01220.39
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00421.23
8.2.110.0060.00320.43
8.2.100.0120.00018.16
8.2.90.0070.00019.22
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0030.00519.66
8.2.50.0030.00618.07
8.2.40.0060.00318.09
8.2.30.0080.00018.05
8.2.20.0000.00817.79
8.2.10.0000.00718.16
8.2.00.0030.00617.67
8.1.280.0160.00725.92
8.1.270.0030.00523.87
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00622.20
8.1.230.0070.00419.21
8.1.220.0030.00517.77
8.1.210.0050.00318.77
8.1.200.0050.00717.13
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0040.00422.05
8.1.150.0040.00418.80
8.1.140.0000.00717.49
8.1.130.0000.00717.83
8.1.120.0050.00217.46
8.1.110.0080.00017.45
8.1.100.0050.00317.45
8.1.90.0040.00417.41
8.1.80.0070.00017.39
8.1.70.0000.00717.45
8.1.60.0090.00017.56
8.1.50.0040.00417.51
8.1.40.0000.00717.35
8.1.30.0030.00517.61
8.1.20.0050.00517.53
8.1.10.0130.00417.46
8.1.00.0110.00717.39
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0000.00718.49
8.0.270.0000.00717.23
8.0.260.0000.00617.19
8.0.250.0000.00716.85
8.0.240.0000.00616.95
8.0.230.0030.00316.85
8.0.220.0030.00316.87
8.0.210.0030.00316.87
8.0.200.0070.00016.95
8.0.190.0040.00416.95
8.0.180.0040.00416.91
8.0.170.0060.00316.89
8.0.160.0090.00516.87
8.0.150.0090.00616.82
8.0.140.0060.00716.74
8.0.130.0080.00415.07
8.0.120.0020.00716.89
8.0.110.0050.00616.91
8.0.100.0040.00816.75
8.0.90.0110.00416.78
8.0.80.0130.00616.92
8.0.70.0080.00616.78
8.0.60.0100.00416.90
8.0.50.0060.00816.82
8.0.30.0140.00616.95
8.0.20.0130.00817.21
8.0.10.0090.00617.02
8.0.00.0070.00816.81
7.4.330.0000.00515.07
7.4.320.0000.00616.52
7.4.300.0000.00616.60
7.4.290.0040.00416.61
7.4.280.0230.00416.66
7.4.270.0130.00416.49
7.4.260.0120.00316.48
7.4.250.0140.00316.46
7.4.240.0060.00616.54
7.4.230.0100.00316.44
7.4.220.0130.00316.55
7.4.210.0050.01116.53
7.4.200.0090.00416.52
7.4.190.0140.00716.55
7.4.180.0170.00616.44
7.4.160.0110.00816.64
7.4.150.0140.00817.00
7.4.140.0100.00917.43
7.4.130.0120.00716.41
7.4.120.0080.01016.41
7.4.110.0100.00816.43
7.4.100.0160.00416.45
7.4.90.0100.00516.55
7.4.80.0120.00817.96
7.4.70.0080.01016.58
7.4.60.0030.01016.47
7.4.50.0080.00616.32
7.4.40.0100.00816.49
7.4.30.0070.01116.43
7.4.20.0140.00616.41
7.4.10.0140.00616.43
7.4.00.0060.01215.39
7.3.330.0050.00614.66
7.3.320.0070.00414.68
7.3.310.0060.00516.35
7.3.300.0100.00216.21
7.3.290.0120.00316.36
7.3.280.0080.00816.30
7.3.270.0170.00616.86
7.3.260.0130.00816.35
7.3.250.0100.00816.25
7.3.240.0120.00816.37
7.3.230.0110.00916.40
7.3.220.0190.00016.18
7.3.210.0110.00816.36
7.3.200.0120.00717.87
7.3.190.0080.01016.38
7.3.180.0150.00316.49
7.3.170.0060.01216.38
7.3.160.0150.00516.33
7.3.150.0120.00916.31
7.3.140.0150.00516.24
7.3.130.0140.00716.35
7.3.120.0120.00815.65
7.3.110.0090.00715.49
7.3.100.0090.00915.46
7.3.90.0160.00515.71
7.3.80.0100.00915.46
7.3.70.0120.00615.58
7.3.60.0140.00315.65
7.3.50.0110.00715.50
7.3.40.0100.00815.71
7.3.30.0110.00815.66
7.3.20.0190.00216.53
7.3.10.0120.00516.50
7.3.00.0100.01116.46
7.2.340.0110.01116.32
7.2.330.0130.00816.46
7.2.320.0130.00916.40
7.2.310.0160.00416.46
7.2.300.0120.00916.56
7.2.290.0170.00316.43
7.2.280.0120.00916.51
7.2.270.0210.00016.30
7.2.260.0130.00716.42
7.2.250.0160.00515.61
7.2.240.0100.00815.50
7.2.230.0100.01015.71
7.2.220.0120.00515.83
7.2.210.0100.00615.73
7.2.200.0090.00715.59
7.2.190.0130.00615.71
7.2.180.0120.00815.76
7.2.170.0140.00515.66
7.2.160.0140.00716.36
7.2.150.0150.00616.46
7.2.140.0120.00916.54
7.2.130.0120.00916.53
7.2.120.0210.00016.62
7.2.110.0150.00616.52
7.2.100.0120.00816.79
7.2.90.0410.00616.51
7.2.80.0190.00416.49
7.2.70.0210.00016.51
7.2.60.0130.00516.62
7.2.50.0180.00416.42
7.2.40.0190.00416.48
7.2.30.0240.00016.75
7.2.20.0180.00716.55
7.2.10.0190.00316.44
7.2.00.0100.00618.19
7.1.330.0120.00515.74
7.1.320.0130.00215.72
7.1.310.0120.00515.60
7.1.300.0140.00215.68
7.1.290.0100.00915.71
7.1.280.0080.00815.66
7.1.270.0100.00815.63
7.1.260.0080.01215.64
7.1.250.0110.01015.45
7.1.240.0150.00415.59
7.1.230.0120.00815.56
7.1.220.0190.00015.52
7.1.210.0570.00415.36
7.1.200.0100.00615.64
7.1.190.0190.00315.57
7.1.180.0210.00015.42
7.1.170.0210.00015.39
7.1.160.0140.00815.30
7.1.150.0200.00315.54
7.1.140.0170.00415.57
7.1.130.0160.00415.45
7.1.120.0200.00015.30
7.1.110.0170.00315.44
7.1.100.0110.00516.79
7.1.90.0160.00415.34
7.1.80.0150.00615.42
7.1.70.0060.00816.23
7.1.60.0120.01017.50
7.1.50.0220.00525.17
7.1.40.0160.00315.61
7.1.30.0140.00615.48
7.1.20.0200.00015.62
7.1.10.0190.00015.39
7.1.00.0120.03718.84
7.0.330.0280.00415.09
7.0.320.0160.00215.03
7.0.310.0120.00615.29
7.0.300.0180.00015.13
7.0.290.0150.00415.18
7.0.280.0140.00715.29
7.0.270.0150.00315.07
7.0.260.0150.00515.21
7.0.250.0160.00315.33
7.0.240.0190.00015.34
7.0.230.0130.00615.32
7.0.220.0200.00015.06
7.0.210.0130.00715.26
7.0.200.0080.00615.78
7.0.190.0150.00415.11
7.0.180.0140.00515.13
7.0.170.0150.00315.39
7.0.160.0160.00315.20
7.0.150.0170.00315.25
7.0.140.0080.04018.60
7.0.130.0160.00415.21
7.0.120.0120.00815.33
7.0.110.0390.00015.05
7.0.100.0110.00915.19
7.0.90.0190.00015.21
7.0.80.0140.00515.14
7.0.70.0170.00015.04
7.0.60.0100.04017.59
7.0.50.0160.03516.46
7.0.40.0080.02417.63
7.0.30.0200.03117.67
7.0.20.0260.03217.65
7.0.10.0100.02317.58
7.0.00.0120.04317.66
5.6.400.0180.00015.73
5.6.390.0140.00615.79
5.6.380.0150.00415.93
5.6.370.0090.00915.77
5.6.360.0120.00715.79
5.6.350.0150.00315.65
5.6.340.0120.00615.94
5.6.330.0190.00015.79
5.6.320.0140.00615.65
5.6.310.0200.00015.66
5.6.300.0140.00515.77
5.6.290.0110.00815.66
5.6.280.0130.03518.27
5.6.270.0180.00015.75
5.6.260.0130.00315.76
5.6.250.0090.00915.90
5.6.240.0130.00416.07
5.6.230.0180.00015.94
5.6.220.0200.00015.87
5.6.210.0110.04218.25
5.6.200.0110.02217.08
5.6.190.0150.03818.38
5.6.180.0290.02318.39
5.6.170.0250.02818.38
5.6.160.0100.02518.28
5.6.150.0150.03117.19
5.6.140.0090.02217.02
5.6.130.0100.02917.03
5.6.120.0120.04018.38
5.6.110.0090.04518.54
5.6.100.0100.03018.50
5.6.90.0140.04218.50
5.6.80.0160.03918.00
5.6.70.0090.00916.04
5.6.60.0120.00616.05
5.6.50.0200.00015.64
5.6.40.0120.00615.93
5.6.30.0120.00615.91
5.6.20.0160.00215.87
5.6.10.0140.00315.84
5.6.00.0180.00015.86
5.5.380.0130.00415.87
5.5.370.0160.00315.87
5.5.360.0140.00515.90
5.5.350.0210.03118.06
5.5.340.0120.03916.86
5.5.330.0060.02618.07
5.5.320.0290.04318.02
5.5.310.0180.03718.02
5.5.300.0110.04016.87
5.5.290.0130.04116.86
5.5.280.0080.03318.23
5.5.270.0070.03218.14
5.5.260.0120.04018.30
5.5.250.0160.03018.17
5.5.240.0190.03218.13
5.5.230.0160.00315.69
5.5.220.0130.00515.83
5.5.210.0180.00015.89
5.5.200.0170.00315.87
5.5.190.0090.01015.82
5.5.180.0090.00915.72
5.5.170.0110.00615.81
5.5.160.0100.00715.77
5.5.150.0070.01115.62
5.5.140.0140.00315.75
5.5.130.0140.00515.51
5.5.120.0200.00015.44
5.5.110.0090.00915.55
5.5.100.0130.00315.92
5.5.90.0130.00415.75
5.5.80.0180.00015.83
5.5.70.0140.00415.75
5.5.60.0110.00715.70
5.5.50.0150.00315.95
5.5.40.0150.00215.75
5.5.30.0080.00815.80
5.5.20.0170.00016.04
5.5.10.0170.00015.97
5.5.00.0150.00315.89
5.4.450.0120.02816.10
5.4.440.0170.02916.08
5.4.430.0110.02216.18
5.4.420.0170.02216.18
5.4.410.0150.02216.08
5.4.400.0200.01715.87
5.4.390.0110.01915.96
5.4.380.0290.02515.58
5.4.370.0250.02615.67
5.4.360.0190.02715.67
5.4.350.0290.02015.61
5.4.340.0270.02115.84
5.4.330.0130.00212.90
5.4.320.0070.02112.65
5.4.310.0090.02012.64
5.4.300.0080.02112.68
5.4.290.0090.02312.53
5.4.280.0100.02312.64
5.4.270.0110.01812.54
5.4.260.0090.02512.41
5.4.250.0130.01612.52
5.4.240.0110.01812.56
5.4.230.0120.01612.36
5.4.220.0110.01912.50
5.4.210.0110.01712.43
5.4.200.0070.02412.36
5.4.190.0100.01912.46
5.4.180.0070.02312.47
5.4.170.0060.02212.47
5.4.160.0090.01912.39
5.4.150.0090.02112.51
5.4.140.0090.02012.38
5.4.130.0080.01912.48
5.4.120.0090.01812.39
5.4.110.0090.01912.50
5.4.100.0080.02012.44
5.4.90.0100.01812.29
5.4.80.0090.01912.45
5.4.70.0090.01912.46
5.4.60.0070.02112.53
5.4.50.0070.02112.47
5.4.40.0080.01912.34
5.4.30.0060.02312.43
5.4.20.0080.01912.44
5.4.10.0120.01612.37
5.4.00.0080.02012.14

preferences:
40.83 ms | 401 KiB | 5 Q