3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( "1" => "0", "2" => "5", "5" => "7", "1C" => "0", "2C" => "5", "5C" => "10", "1S" => "15", "5S" => "20" ); Foreach($array as $key => $item){ If(!is_numeric(substr($key, -1))){ $new[substr($key, -1)][substr($key, 0,1)] = $item; }Else{ $new[] = $item; } } Var_dump($new);

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.5.00.0140.00820.04
8.4.150.0030.00014.05
8.4.140.0150.00717.48
8.4.130.0110.00819.56
8.4.120.0120.00722.16
8.4.110.0080.00218.91
8.4.100.0150.00618.91
8.4.90.0070.00222.26
8.4.80.0040.00520.71
8.4.70.0120.00918.15
8.4.60.0100.01118.55
8.4.50.0110.00918.68
8.4.40.0070.00417.91
8.4.30.0060.00317.77
8.4.20.0070.00317.96
8.4.10.0030.01717.59
8.3.280.0120.01018.41
8.3.270.0090.01216.50
8.3.260.0090.00816.83
8.3.250.0080.01018.97
8.3.240.0080.00816.91
8.3.230.0090.00916.71
8.3.220.0030.00419.03
8.3.210.0080.01216.44
8.3.200.0030.00616.84
8.3.190.0040.00417.30
8.3.180.0110.00716.70
8.3.170.0120.00918.79
8.3.160.0100.00017.34
8.3.150.0140.00417.03
8.3.140.0110.00716.84
8.3.130.0000.00818.46
8.3.120.0040.00718.95
8.3.110.0090.00020.94
8.3.100.0030.00616.78
8.3.90.0040.00426.77
8.3.80.0090.00016.63
8.3.70.0000.01516.63
8.3.60.0090.00618.43
8.3.50.0030.01318.12
8.3.40.0090.00618.64
8.3.30.0060.00918.88
8.3.20.0050.00319.24
8.3.10.0040.00419.32
8.3.00.0030.00623.62
8.2.290.0110.00720.16
8.2.280.0090.01120.39
8.2.270.0150.00416.91
8.2.260.0040.01116.41
8.2.250.0000.01519.20
8.2.240.0130.00616.94
8.2.230.0060.00322.58
8.2.220.0060.00324.06
8.2.210.0170.00026.77
8.2.200.0090.00016.63
8.2.190.0100.01018.16
8.2.180.0080.00825.92
8.2.170.0110.00418.96
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00019.83
8.2.120.0040.00426.35
8.2.110.0140.00722.10
8.2.100.0110.00017.78
8.2.90.0000.00822.32
8.2.80.0000.00817.97
8.2.70.0000.00817.93
8.2.60.0080.00018.03
8.2.50.0040.00418.10
8.2.40.0000.00919.46
8.2.30.0040.00419.55
8.2.20.0040.00418.11
8.2.10.0040.00418.13
8.2.00.0030.00519.49
8.1.330.0080.00321.93
8.1.320.0150.00317.64
8.1.310.0040.00418.32
8.1.300.0140.00318.38
8.1.290.0060.00330.84
8.1.280.0000.01425.92
8.1.270.0070.00023.96
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0110.00022.59
8.1.230.0080.00321.04
8.1.220.0040.00417.79
8.1.210.0040.00418.98
8.1.200.0000.00817.23
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0080.00018.55
8.1.160.0000.00718.90
8.1.150.0040.00418.86
8.1.140.0030.00617.73
8.1.130.0000.00718.88
8.1.120.0000.00717.39
8.1.110.0000.00717.46
8.1.100.0070.00017.43
8.1.90.0000.00717.43
8.1.80.0000.00717.52
8.1.70.0000.00717.38
8.1.60.0100.00017.64
8.1.50.0080.00017.49
8.1.40.0000.00817.52
8.1.30.0050.00317.55
8.1.20.0040.00417.61
8.1.10.0040.00417.52
8.1.00.0080.00017.48
8.0.300.0070.00019.89
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0030.00316.76
8.0.260.0000.00617.14
8.0.250.0040.00416.89
8.0.240.0000.00716.91
8.0.230.0020.00516.95
8.0.220.0050.00216.95
8.0.210.0000.00716.87
8.0.200.0040.00416.86
8.0.190.0000.00816.89
8.0.180.0000.00816.96
8.0.170.0050.00516.95
8.0.160.0070.00016.99
8.0.150.0000.00716.82
8.0.140.0040.00316.69
8.0.130.0000.00613.31
8.0.120.0030.00516.76
8.0.110.0050.00316.80
8.0.100.0040.00416.93
8.0.90.0080.00016.96
8.0.80.0080.01016.88
8.0.70.0070.00016.83
8.0.60.0000.00716.94
8.0.50.0000.00816.76
8.0.30.0080.01117.14
8.0.20.0080.01217.40
8.0.10.0080.00017.06
8.0.00.0080.01016.80
7.4.330.0000.00515.55
7.4.320.0000.00616.64
7.4.300.0000.00616.50
7.4.290.0030.00316.50
7.4.280.0000.00716.57
7.4.270.0000.00716.50
7.4.260.0040.00416.53
7.4.250.0070.00016.55
7.4.240.0030.00316.63
7.4.230.0000.00716.63
7.4.220.0000.00716.49
7.4.210.0070.00916.54
7.4.200.0040.00416.61
7.4.160.0080.00816.55
7.4.140.0120.00717.86
7.4.130.0120.00616.46
7.4.120.0140.00716.53
7.4.110.0090.00916.63
7.4.100.0100.00716.47
7.4.90.0120.00616.59
7.4.80.0060.01519.39
7.4.70.0100.00716.59
7.4.60.0120.01216.56
7.4.50.0090.00416.54
7.4.40.0100.01316.45
7.4.00.0090.00914.85
7.3.330.0000.00613.29
7.3.320.0060.00013.03
7.3.310.0040.00416.41
7.3.300.0030.00316.18
7.3.290.0080.00016.36
7.3.280.0050.00916.34
7.3.260.0080.01216.44
7.3.240.0110.00816.45
7.3.230.0120.00616.36
7.3.210.0060.01116.57
7.3.200.0130.00316.46
7.3.190.0060.01216.33
7.3.180.0130.00516.36
7.3.170.0140.00316.43
7.3.160.0060.00916.34
7.3.120.0040.01414.57
7.3.110.0030.01415.06
7.3.100.0110.00414.66
7.3.90.0070.00314.85
7.3.80.0130.00015.20
7.3.70.0030.01014.64
7.3.60.0040.01114.86
7.3.50.0140.00314.81
7.3.40.0030.00615.03
7.3.30.0070.01014.75
7.3.20.0060.00616.66
7.3.10.0060.00516.78
7.3.00.0070.00616.45
7.2.330.0150.00416.73
7.2.320.0030.01516.79
7.2.310.0140.02916.67
7.2.300.0070.01016.49
7.2.290.0100.01316.70
7.2.250.0100.00715.26
7.2.240.0090.01215.06
7.2.230.0040.00814.61
7.2.220.0100.00014.96
7.2.210.0030.01014.96
7.2.200.0040.01214.77
7.2.190.0040.01115.04
7.2.180.0000.01714.73
7.2.170.0030.01014.98
7.2.130.0100.00716.83
7.2.120.0070.01016.77
7.2.110.0100.00317.08
7.2.100.0070.00416.53
7.2.90.0060.00916.81
7.2.80.0090.00616.84
7.2.70.0070.00417.01
7.2.60.0110.00715.83
7.2.50.0250.00615.86
7.2.40.1130.00916.29
7.2.30.0090.01016.25
7.2.20.0080.00816.14
7.2.10.1340.00816.27
7.2.00.1490.01116.17
7.1.330.0030.01015.67
7.1.320.0030.01015.87
7.1.310.0070.00415.97
7.1.300.0090.00915.52
7.1.290.0000.01715.60
7.1.280.0040.00815.76
7.1.270.0070.00715.86
7.1.260.0030.00915.60
7.1.250.0030.00915.62
7.1.200.0090.00615.97
7.1.170.0190.00713.96
7.1.160.0230.01116.89
7.1.150.0160.01217.06
7.1.140.0320.01216.90
7.1.130.2720.00817.13
7.1.120.2710.01317.04
7.1.110.2910.00815.99
7.1.100.2570.00916.16
7.1.90.2080.00916.15
7.1.80.1940.01016.46
7.1.70.1920.00915.43
7.1.60.2820.01433.15
7.1.50.2380.01233.05
7.1.40.2180.01932.34
7.1.30.3260.01632.72
7.1.20.2270.01232.79
7.1.10.2960.01114.75
7.1.00.1910.01314.73

preferences:
105.68 ms | 403 KiB | 5 Q