3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('name', 'name', 'email', 'name', 'address', 'phone', 'phone'); foreach ($array as $value) { $keys = array_keys($array, $value); // get rid of the first entry array_shift($keys); // add counters to duplicates for ($i = 0; $i < count($keys); $i++) { $array[$keys[$i]] = $value . "_" . ($i + 2); } } 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.0130.00718.43
8.3.50.0060.00917.99
8.3.40.0090.00618.89
8.3.30.0090.00918.96
8.3.20.0080.00021.81
8.3.10.0040.00421.76
8.3.00.0080.00022.46
8.2.180.0080.00816.63
8.2.170.0180.00022.96
8.2.160.0130.00020.35
8.2.150.0050.00224.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0030.00717.75
8.2.110.0110.00021.04
8.2.100.0040.00817.84
8.2.90.0030.00519.48
8.2.80.0050.00220.54
8.2.70.0030.00618.03
8.2.60.0080.00018.22
8.2.50.0050.00318.10
8.2.40.0040.00419.38
8.2.30.0040.00419.17
8.2.20.0000.00718.01
8.2.10.0000.00718.95
8.2.00.0070.00019.18
8.1.280.0060.01025.92
8.1.270.0040.00422.48
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.02
8.1.230.0040.00720.96
8.1.220.0050.00517.74
8.1.210.0080.00018.97
8.1.200.0060.00317.38
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0080.00018.48
8.1.160.0000.00719.05
8.1.150.0070.00018.89
8.1.140.0040.00418.93
8.1.130.0050.00317.32
8.1.120.0000.00717.53
8.1.110.0000.00717.45
8.1.100.0040.00417.36
8.1.90.0060.00317.41
8.1.80.0070.00017.34
8.1.70.0000.00717.48
8.1.60.0040.00417.59
8.1.50.0040.00417.40
8.1.40.0000.00917.57
8.1.30.0040.00417.50
8.1.20.0000.00717.52
8.1.10.0030.00617.56
8.1.00.0080.00017.49
8.0.300.0040.00420.20
8.0.290.0080.00316.63
8.0.280.0000.00718.36
8.0.270.0060.00319.04
8.0.260.0000.00616.72
8.0.250.0070.00016.93
8.0.240.0070.00016.92
8.0.230.0070.00016.88
8.0.220.0060.00316.94
8.0.210.0000.00716.82
8.0.200.0000.00716.96
8.0.190.0030.00316.96
8.0.180.0000.00816.86
8.0.170.0000.00916.84
8.0.160.0000.00716.95
8.0.150.0040.00416.84
8.0.140.0070.00016.74
8.0.130.0030.00313.35
8.0.120.0040.00416.87
8.0.110.0070.00016.78
8.0.100.0030.00416.93
8.0.90.0040.00416.76
8.0.80.0060.01616.88
8.0.70.0040.00416.93
8.0.60.0050.00316.68
8.0.50.0040.00416.75
8.0.30.0090.00916.95
8.0.20.0140.00717.03
8.0.10.0040.00416.96
8.0.00.0110.00816.59
7.4.330.0020.00215.55
7.4.320.0060.00016.43
7.4.300.0000.00616.49
7.4.290.0000.00716.35
7.4.280.0080.00016.50
7.4.270.0000.00816.64
7.4.260.0000.00513.38
7.4.250.0070.00016.51
7.4.240.0030.00516.50
7.4.230.0030.00316.29
7.4.220.0020.00516.50
7.4.210.0100.00716.60
7.4.200.0030.00316.47
7.4.130.0140.00316.54
7.4.120.0210.00816.37
7.4.110.0080.00816.52
7.4.100.0070.01316.58
7.4.90.0070.01016.64
7.4.80.0090.00619.39
7.4.70.0130.00316.52
7.4.60.0120.00916.49
7.4.50.0040.01116.36
7.4.40.0100.00616.61
7.4.00.0100.00714.84
7.3.330.0000.00616.25
7.3.320.0030.00313.22
7.3.310.0000.00716.41
7.3.300.0000.00716.29
7.3.290.0000.00716.30
7.3.260.0120.00716.52
7.3.230.0160.00316.43
7.3.210.0180.00616.46
7.3.200.0140.00416.58
7.3.190.0120.00416.51
7.3.180.0110.00816.41
7.3.170.0050.01116.37
7.3.160.0070.01016.29
7.3.110.0120.00514.81
7.3.100.0070.00614.84
7.3.90.0040.00914.95
7.3.80.0080.00614.76
7.3.70.0080.00614.77
7.3.60.0050.00914.65
7.3.50.0100.00414.74
7.3.40.0070.00714.76
7.3.30.0110.00314.65
7.3.20.0060.00814.70
7.3.10.0080.00814.71
7.3.00.0060.01114.82
7.2.330.0060.01216.46
7.2.320.0140.00316.68
7.2.310.0130.00316.68
7.2.300.0150.00816.46
7.2.290.0100.01016.71
7.2.240.0130.00315.08
7.2.230.0080.00615.04
7.2.220.0050.00915.02
7.2.210.0060.00914.97
7.2.200.0120.00315.03
7.2.190.0100.00615.01
7.2.180.0050.01114.94
7.2.170.0070.00715.06
7.2.160.0060.00915.09
7.2.150.0120.00515.19
7.2.140.0090.00815.10
7.2.130.0120.00615.19
7.2.120.0080.00815.17
7.2.110.0030.01215.07
7.2.100.0040.01015.02
7.2.90.0070.00815.08
7.2.80.0050.01015.21
7.2.70.0030.01214.92
7.2.60.0100.00614.98
7.2.50.0120.00514.92
7.2.40.0100.00815.08
7.2.30.0060.01015.09
7.2.20.0070.00915.04
7.2.10.0130.00515.16
7.2.00.0070.01015.01
7.1.330.0030.01113.82
7.1.320.0080.00713.96
7.1.310.0070.00814.11
7.1.300.0050.01113.99
7.1.290.0110.00414.09
7.1.280.0080.00514.05
7.1.270.0110.00314.01
7.1.260.0120.00514.03
7.1.250.0100.00514.02
7.1.240.0080.00813.90
7.1.230.0130.00013.88
7.1.220.0100.00713.84
7.1.210.0090.00613.99
7.1.200.0130.00413.59
7.1.190.0060.01514.07
7.1.180.0140.00613.82
7.1.170.0070.01113.73
7.1.160.0150.00913.76
7.1.150.0170.00013.99
7.1.140.0120.00913.89
7.1.130.0140.00514.07
7.1.120.0190.00513.75
7.1.110.0040.01613.92
7.1.100.0030.01913.87
7.1.90.0040.01314.05
7.1.80.0170.00614.05
7.1.70.0070.01413.92
7.1.60.0110.00713.77
7.1.50.0110.01113.55
7.1.40.0100.00713.93
7.1.30.0070.00713.69
7.1.20.0040.01613.72
7.1.10.0110.00814.00
7.1.00.0060.01113.75
7.0.330.0060.01013.30
7.0.320.0080.00713.28
7.0.310.0120.00413.45
7.0.300.0190.00013.29
7.0.290.0180.00013.52
7.0.280.0150.00613.22
7.0.270.0170.00713.11
7.0.260.0100.01013.42
7.0.250.0030.01213.49
7.0.240.0100.01113.54
7.0.230.0170.00513.53
7.0.220.0090.01513.74
7.0.210.0060.01313.47
7.0.200.0030.01713.39
7.0.190.0130.01013.34
7.0.180.0040.01113.16
7.0.170.0090.01013.36
7.0.160.0160.00013.32
7.0.150.0040.01113.62
7.0.140.0100.00713.55
7.0.130.0180.00013.45
7.0.120.0080.00913.60
7.0.110.0320.01013.25
7.0.100.0080.00813.43
7.0.90.0150.00313.25
7.0.80.0080.01113.30
7.0.70.0170.00313.54
7.0.60.0120.00813.52
7.0.50.0130.00313.83
7.0.40.0180.00013.63
7.0.30.0130.00813.71
7.0.20.0120.01013.30
7.0.10.0130.00313.70
7.0.00.0040.00813.77
5.6.400.0070.01314.33
5.6.390.0140.00614.64
5.6.380.0080.00813.95
5.6.370.0130.00314.61
5.6.360.0090.01314.45
5.6.350.0110.00614.64
5.6.340.0130.00514.32
5.6.330.0090.00614.65
5.6.320.0170.00014.20
5.6.310.0110.00714.29
5.6.300.0040.01114.52
5.6.290.0100.00814.30
5.6.280.0000.01614.11
5.6.270.0060.00914.01
5.6.260.0040.01214.31
5.6.250.0070.01314.30
5.6.240.0000.01714.24
5.6.230.0060.01114.51
5.6.220.0130.00514.49
5.6.210.0160.00414.48
5.6.200.0120.00314.29
5.6.190.0070.01114.27
5.6.180.0130.00314.04
5.6.170.0120.00514.20
5.6.160.0090.00614.04
5.6.150.0120.00314.25
5.6.140.0140.00314.14
5.6.130.0110.00714.41
5.6.120.0100.01014.14
5.6.110.0110.00514.36
5.6.100.0120.00814.23
5.6.90.0110.00614.41
5.6.80.0070.01414.34
5.6.70.0070.01014.09
5.6.60.0150.00814.31
5.6.50.0200.00314.17
5.6.40.0080.01214.21
5.6.30.0110.00814.27
5.6.20.0160.00814.55
5.6.10.0190.00414.36
5.6.00.0090.00914.33
5.5.380.0110.00713.89
5.5.370.0160.00614.34
5.5.360.0110.00814.29
5.5.350.0080.01214.11
5.5.340.0160.00614.16
5.5.330.0060.01514.38
5.5.320.0160.00414.51
5.5.310.0040.02014.43
5.5.300.0180.00414.15
5.5.290.0090.01314.17
5.5.280.0150.00914.38
5.5.270.0140.01014.29
5.5.260.0130.00814.20
5.5.250.0150.00614.46
5.5.240.0180.00414.19
5.5.230.0110.01114.05
5.5.220.0110.01113.95
5.5.210.0150.00913.88
5.5.200.0140.00714.22
5.5.190.0130.00514.30
5.5.180.0110.01214.24
5.5.170.0140.00713.97
5.5.160.0140.00713.92
5.5.150.0120.00814.45
5.5.140.0080.01714.38
5.5.130.0130.01014.39
5.5.120.0150.01214.37
5.5.110.0220.00514.01
5.5.100.0100.01514.42
5.5.90.0150.00814.20
5.5.80.0210.00214.18
5.5.70.0080.01413.84
5.5.60.0150.00613.74
5.5.50.0170.00514.07
5.5.40.0110.01514.16
5.5.30.0150.00514.25
5.5.20.0200.00413.79
5.5.10.0140.01114.21
5.5.00.0110.00713.89
5.4.450.0060.01011.12
5.4.440.0120.00611.08
5.4.430.0080.00811.35
5.4.420.0060.00911.20
5.4.410.0110.00611.10
5.4.400.0120.00310.93
5.4.390.0100.00711.07
5.4.380.0120.00610.75
5.4.370.0030.01310.81
5.4.360.0120.00310.98
5.4.350.0140.00511.16
5.4.340.0160.00310.81
5.4.330.0130.00510.99
5.4.320.0090.00611.08
5.4.310.0150.00311.14
5.4.300.0110.00711.13
5.4.290.0090.00611.10
5.4.280.0120.00910.93
5.4.270.0080.01210.90
5.4.260.0090.00911.00
5.4.250.0080.00910.69
5.4.240.0040.01010.86
5.4.230.0100.00710.75
5.4.220.0110.00410.97
5.4.210.0130.00511.01
5.4.200.0160.00310.99
5.4.190.0090.00910.86
5.4.180.0100.00510.69
5.4.170.0070.00610.78
5.4.160.0060.00910.91
5.4.150.0130.00310.68
5.4.140.0090.00610.82
5.4.130.0170.00010.95
5.4.120.0070.01010.94
5.4.110.0110.00610.68
5.4.100.0040.01611.11
5.4.90.0090.00610.98
5.4.80.0040.00910.90
5.4.70.0110.00811.21
5.4.60.0120.00611.08
5.4.50.0150.00011.11
5.4.40.0090.00611.05
5.4.30.0060.00911.29
5.4.20.0140.00211.25
5.4.10.0110.00411.23
5.4.00.0030.00711.17
5.3.290.0060.01110.68
5.3.280.0100.00510.68
5.3.270.0060.01010.68
5.3.260.0040.01110.69
5.3.250.0090.00610.68
5.3.240.0070.00710.68
5.3.230.0180.00010.68
5.3.220.0100.00710.68
5.3.210.0100.00310.68
5.3.200.0080.00810.68
5.3.190.0080.00810.68
5.3.180.0100.00510.68
5.3.170.0130.00010.69
5.3.160.0180.00010.70
5.3.150.0100.00310.68
5.3.140.0120.00310.68
5.3.130.0080.00410.68
5.3.120.0100.00310.74
5.3.110.0040.00810.68
5.3.100.0060.00610.68
5.3.90.0080.00510.68
5.3.80.0120.00310.68
5.3.70.0090.00310.68
5.3.60.0070.01110.68
5.3.50.0090.00910.68
5.3.40.0100.00010.68
5.3.30.0030.00710.68
5.3.20.0030.00710.68
5.3.10.0080.00910.68
5.3.00.0000.01210.68
5.2.170.0080.00410.68
5.2.160.0120.00410.68
5.2.150.0110.00010.68
5.2.140.0120.00010.68
5.2.130.0030.00810.68
5.2.120.0070.00910.68
5.2.110.0000.01110.68
5.2.100.0040.00910.68
5.2.90.0070.00710.68
5.2.80.0130.00010.68
5.2.70.0090.00610.68
5.2.60.0000.01210.68
5.2.50.0060.00910.68
5.2.40.0090.00410.68
5.2.30.0050.00910.68
5.2.20.0060.01010.68
5.2.10.0080.00810.68
5.2.00.0120.00010.68
5.1.60.0110.00010.68
5.1.50.0080.00210.68
5.1.40.0080.00610.68
5.1.30.0080.00410.68
5.1.20.0110.00410.68
5.1.10.0000.01110.68
5.1.00.0060.00610.68
5.0.50.0090.00010.68
5.0.40.0100.00010.68
5.0.30.0040.00410.68
5.0.20.0040.00810.68
5.0.10.0020.00710.68
5.0.00.0030.00610.68
4.4.90.0090.00010.68
4.4.80.0110.00010.68
4.4.70.0090.00010.68
4.4.60.0000.00910.68
4.4.50.0100.00010.68
4.4.40.0100.00010.68
4.4.30.0040.00710.68
4.4.20.0050.00310.68
4.4.10.0070.00210.68
4.4.00.0050.00510.68
4.3.110.0050.00510.68
4.3.100.0080.00010.68
4.3.90.0030.00710.68
4.3.80.0070.00010.68
4.3.70.0050.00310.68
4.3.60.0050.00510.68
4.3.50.0000.01010.68
4.3.40.0060.00310.68
4.3.30.0000.00610.68
4.3.20.0030.00310.68
4.3.10.0040.00710.68
4.3.00.0040.00410.68

preferences:
74.64 ms | 400 KiB | 5 Q