3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 'package-name-1' => 'package1', 'package-serve-1' => 'sdasd', 'package-price-date-1' => '31-03-2020' , 'foodType-1-1' => 'Rice', 'foodTags-1-1' => 'rice', 'foodNotes-1-1' => 'notes', 'foodchoose-1-1' => 0, 'package-name-2' => 'package2', 'package-serve-2' => 'Leaf', 'package-price-date-2' => '12-08-2020', 'foodType-2-2' => 'rice1', 'foodTags-2-2' => 'rice1', 'foodNotes-2-2' => 'dasd', 'foodchoose-2-2' => 3, 'foodType-2-3' => 'rice2', 'foodTags-2-3' => 'rice2', 'foodNotes-2-3' => 'qwewe', 'foodchoose-2-3' => 0 ); $newArray = []; $k = 0; foreach($array as $key=>$value){ if(strpos($key,'package-name') !== false){ $explodedkeys = explode('-',$key); $id = end($explodedkeys); $k = $id-1; } $newArray[$k][$key] = $value; } print_r($newArray);

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.130.0100.00417.53
8.4.120.0130.00620.72
8.4.110.0050.00418.86
8.4.100.0140.00717.59
8.4.90.0070.00222.40
8.4.80.0140.00618.76
8.4.70.0050.00319.05
8.4.60.0070.01318.93
8.4.50.0080.01318.52
8.4.40.0200.00717.53
8.4.30.0060.01318.57
8.4.20.0130.00719.51
8.4.10.0090.00019.75
8.3.260.0080.01216.37
8.3.250.0140.00518.67
8.3.240.0110.00916.57
8.3.230.0060.00416.45
8.3.220.0100.00618.88
8.3.210.0040.00316.70
8.3.200.0050.00516.67
8.3.190.0130.00517.08
8.3.180.0090.00619.01
8.3.170.0110.00716.71
8.3.160.0130.00617.19
8.3.150.0110.00716.58
8.3.140.0060.00321.04
8.3.130.0030.00618.71
8.3.120.0100.00020.70
8.3.110.0000.01620.25
8.3.100.0070.00320.21
8.3.90.0040.00418.30
8.3.80.0030.00617.97
8.3.70.0140.00716.50
8.3.60.0090.00918.30
8.3.50.0110.00724.61
8.3.40.0110.00420.47
8.3.30.0110.00318.75
8.3.20.0040.00420.82
8.3.10.0080.00020.34
8.3.00.0040.00420.64
8.2.290.0040.00520.45
8.2.280.0090.01018.33
8.2.270.0120.00616.61
8.2.260.0150.00316.61
8.2.250.0000.00818.28
8.2.240.0150.00316.97
8.2.230.0080.00020.94
8.2.220.0080.00024.06
8.2.210.0070.00726.77
8.2.200.0030.00616.75
8.2.190.0060.00916.63
8.2.180.0070.01018.29
8.2.170.0060.00822.96
8.2.160.0030.01221.06
8.2.150.0070.00024.18
8.2.140.0070.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00420.96
8.2.110.0100.00022.25
8.2.100.0060.00618.09
8.2.90.0040.00418.03
8.2.80.0080.00019.16
8.2.70.0040.00417.93
8.2.60.0040.00418.16
8.2.50.0040.00419.23
8.2.40.0040.00421.02
8.2.30.0050.00319.18
8.2.20.0040.00418.12
8.2.10.0000.00719.29
8.2.00.0000.00819.29
8.1.330.0070.01222.13
8.1.320.0040.00615.84
8.1.310.0110.00716.04
8.1.300.0110.00416.56
8.1.290.0060.00318.88
8.1.280.0100.00725.92
8.1.270.0090.00022.58
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00620.87
8.1.230.0040.00721.04
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0060.00317.36
8.1.190.0090.00017.35
8.1.180.0040.00418.89
8.1.170.0060.00318.71
8.1.160.0030.00619.02
8.1.150.0080.00018.83
8.1.140.0000.00718.79
8.1.130.0030.00317.50
8.1.120.0040.00417.43
8.1.110.0060.00317.34
8.1.100.0070.00017.50
8.1.90.0030.00617.47
8.1.80.0000.00717.45
8.1.70.0070.00017.45
8.1.60.0000.00817.55
8.1.50.0060.00317.51
8.1.40.0000.00717.42
8.1.30.0040.00417.64
8.1.20.0030.00617.64
8.1.10.0000.00817.47
8.1.00.0040.00417.48
8.0.300.0040.00419.96
8.0.290.0000.00716.63
8.0.280.0000.00718.36
8.0.270.0040.00416.79
8.0.260.0000.00816.75
8.0.250.0000.00717.04
8.0.240.0070.00016.95
8.0.230.0030.00416.95
8.0.220.0070.00016.84
8.0.210.0050.00316.97
8.0.200.0030.00517.00
8.0.190.0040.00417.05
8.0.180.0050.00317.03
8.0.170.0030.00716.94
8.0.160.0030.00516.97
8.0.150.0040.00416.91
8.0.140.0080.00016.80
8.0.130.0030.00313.37
8.0.120.0070.00016.95
8.0.110.0040.00416.78
8.0.100.0050.00316.93
8.0.90.0090.00016.79
8.0.80.0090.00916.89
8.0.70.0040.00416.81
8.0.60.0030.00416.77
8.0.50.0000.00716.83
8.0.30.0060.01017.14
8.0.20.0080.01216.98
8.0.10.0080.00016.96
8.0.00.0100.01016.75
7.4.330.0050.00015.55
7.4.320.0000.00616.43
7.4.300.0030.00316.61
7.4.290.0070.00016.61
7.4.280.0050.00316.58
7.4.270.0000.00716.51
7.4.260.0030.00313.27
7.4.250.0070.00016.45
7.4.240.0030.00316.54
7.4.230.0000.00816.64
7.4.220.0020.00516.52
7.4.210.0080.00616.64
7.4.200.0070.00016.58
7.4.130.0080.01116.67
7.4.120.0170.00316.63
7.4.110.0090.00616.63
7.4.100.0090.00916.43
7.4.90.0110.00616.48
7.4.80.0160.00619.39
7.4.70.0130.00316.60
7.4.60.0070.01016.44
7.4.50.0030.00716.69
7.4.40.0120.00416.36
7.4.30.0060.01516.46
7.4.20.0100.00716.21
7.4.10.0150.00616.34
7.4.00.0120.00916.35
7.3.330.0070.00016.29
7.3.320.0000.00613.08
7.3.310.0000.00716.41
7.3.300.0000.00716.36
7.3.290.0070.00816.32
7.3.280.0150.00016.32
7.3.260.0090.00916.43
7.3.240.0080.00916.32
7.3.230.0060.01116.31
7.3.210.0110.00716.49
7.3.200.0160.00716.31
7.3.190.0060.01316.42
7.3.180.0130.00516.31
7.3.170.0150.00316.30
7.3.160.0120.00916.57
7.3.150.0060.01016.33
7.3.140.0090.00616.64
7.3.130.0140.00616.34
7.3.120.0200.00016.34
7.3.110.0060.00916.19
7.3.100.0060.00916.44
7.3.90.0080.00816.39
7.3.80.0030.01416.44
7.3.70.0080.00816.48
7.3.60.0040.01216.41
7.3.50.0080.00816.32
7.3.40.0120.00316.41
7.3.30.0130.00316.37
7.3.20.0110.00618.16
7.3.10.0060.01018.15
7.3.00.0080.00818.35
7.2.330.0090.01216.43
7.2.320.0130.00316.61
7.2.310.0060.00916.60
7.2.300.0170.00716.70
7.2.290.0110.00616.80
7.2.280.0030.01316.27
7.2.270.0030.01316.54
7.2.260.0140.01016.73
7.2.250.0070.01016.77
7.2.240.0080.00816.50
7.2.230.0090.00616.79
7.2.220.0060.01216.41
7.2.210.0070.01016.49
7.2.200.0070.01016.46
7.2.190.0030.01416.54
7.2.180.0030.01416.54
7.2.170.0130.00316.50
7.2.160.0100.00716.49
7.2.150.0130.00618.48
7.2.140.0070.01018.49
7.2.130.0060.00918.34
7.2.120.0030.01318.52
7.2.110.0110.00518.54
7.2.100.0110.00718.47
7.2.90.0030.01418.54
7.2.80.0100.01418.39
7.2.70.0140.01418.47
7.2.60.0150.01018.50
7.2.50.0100.00618.42
7.2.40.0040.01418.47
7.2.30.0030.01418.63
7.2.20.0040.01118.44
7.2.10.0030.01518.52
7.2.00.0060.01218.31

preferences:
27.72 ms | 403 KiB | 5 Q