3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr= array ( 'supplier_id' => 1, 'filter_name' => array ( 0 => 'product 1', 1 => 'Product 2', 2 => 'Product 3' ), 'quantity' => array ( 0 => 3, 1 => 10, 2 => 2 ), 'unit' => array ( 0 => 'pkts', 1 => 'ltrs', 2 => 'pkts' ), 'price' => Array ( 0 => 11, 1 => 100, 2 => 10 ), 'gross_amount' => Array ( 0 => 33, 1 => 1000, 2 => 20 ), 'vat' => array ( 0 => 0, 1 => 0, 2 => 0 ), 'net_amount' => array ( 0 => 33, 1 => 1000, 2 => 20 ), ); //echo "<pre>"; print_r($arr); $i = 0; $newArray = array(); do{ foreach($arr as $key=>$val){ if($key == 'supplier_id'){ $newArray[$key] = $val; }else{ $newArray[$i][$key] = $val[$i]; } } $i++; }while($i<3); echo "<pre>"; 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.3.130.0000.00818.43
8.3.120.0040.00420.76
8.3.110.0080.00016.87
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0050.00517.97
8.3.70.0090.00918.68
8.3.60.0160.00616.88
8.3.50.0170.00617.51
8.3.40.0150.00018.80
8.3.30.0130.00318.73
8.3.20.0120.00321.72
8.3.10.0080.00021.78
8.3.00.0040.00419.68
8.2.250.0040.00416.92
8.2.240.0060.00317.21
8.2.230.0070.00320.94
8.2.220.0100.01337.54
8.2.210.0080.00026.77
8.2.200.0060.00316.75
8.2.190.0090.00616.62
8.2.180.0100.00625.92
8.2.170.0080.00819.13
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00726.16
8.2.120.0080.00019.48
8.2.110.0070.00320.38
8.2.100.0090.00317.85
8.2.90.0000.00818.34
8.2.80.0040.00419.00
8.2.70.0060.00317.75
8.2.60.0000.00817.63
8.2.50.0040.00417.55
8.2.40.0030.00519.36
8.2.30.0040.00419.28
8.2.20.0080.00018.00
8.2.10.0040.00418.13
8.2.00.0040.00418.07
8.1.300.0060.01218.27
8.1.290.0000.00930.84
8.1.280.0070.01425.92
8.1.270.0000.00723.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0040.00422.61
8.1.230.0070.00420.97
8.1.220.0060.00317.79
8.1.210.0060.00320.82
8.1.200.0040.00417.35
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0050.00217.70
8.1.160.0050.00318.93
8.1.150.0040.00418.83
8.1.140.0070.00019.50
8.1.130.0000.00718.80
8.1.120.0030.00517.45
8.1.110.0060.00317.43
8.1.100.0050.00317.30
8.1.90.0000.00817.48
8.1.80.0040.00417.37
8.1.70.0030.00517.48
8.1.60.0040.00417.60
8.1.50.0000.00717.50
8.1.40.0070.00017.46
8.1.30.0000.00717.66
8.1.20.0040.00417.57
8.1.10.0080.00017.51
8.1.00.0040.00417.54
8.0.300.0030.00320.07
8.0.290.0000.00716.58
8.0.280.0050.00318.55
8.0.270.0030.00317.18
8.0.260.0070.00018.46
8.0.250.0000.00716.94
8.0.240.0030.00316.89
8.0.230.0040.00416.89
8.0.220.0030.00316.89
8.0.210.0000.00716.77
8.0.200.0030.00316.88
8.0.190.0000.00816.93
8.0.180.0000.00716.90
8.0.170.0000.00717.00
8.0.160.0040.00416.78
8.0.150.0000.00816.74
8.0.140.0060.00316.75
8.0.130.0000.00613.34
8.0.120.0040.00416.83
8.0.110.0040.00416.91
8.0.100.0040.00416.78
8.0.90.0040.00416.73
8.0.80.0070.00716.82
8.0.70.0070.00016.96
8.0.60.0040.00416.91
8.0.50.0040.00416.92
8.0.30.0100.00816.98
8.0.20.0100.01117.40
8.0.10.0040.00417.04
8.0.00.0070.01116.86
7.4.330.0030.00315.55
7.4.320.0030.00316.41
7.4.300.0060.00016.60
7.4.290.0030.00316.50
7.4.280.0000.00716.57
7.4.270.0030.00316.42
7.4.260.0030.00316.55
7.4.250.0070.00016.59
7.4.240.0080.00016.67
7.4.230.0040.00416.68
7.4.220.0130.00716.63
7.4.210.0070.01016.43
7.4.200.0000.00716.50
7.4.160.0100.00616.45
7.4.150.0120.00617.40
7.4.140.0100.01117.86
7.4.130.0130.00316.46
7.4.120.0090.01116.52
7.4.110.0170.00016.64
7.4.100.0130.00416.41
7.4.90.0140.00516.35
7.4.80.0160.00319.39
7.4.70.0160.00616.60
7.4.60.0100.00716.52
7.4.50.0040.01116.46
7.4.40.0000.01716.53
7.4.30.0080.00816.48
7.4.10.0140.00314.92
7.4.00.0090.00614.92
7.3.330.0060.00013.12
7.3.320.0000.00513.02
7.3.310.0040.00416.34
7.3.300.0040.00416.32
7.3.290.0090.00616.32
7.3.280.0120.00416.36
7.3.270.0110.00617.40
7.3.260.0100.00716.57
7.3.250.0150.00516.42
7.3.240.0100.00816.54
7.3.230.0070.01016.54
7.3.210.0130.00416.31
7.3.200.0110.00616.51
7.3.190.0150.00916.44
7.3.180.0200.00016.68
7.3.170.0100.00716.73
7.3.160.0070.01016.67
7.3.130.0140.00615.16
7.3.120.0060.01014.96
7.3.110.0070.00814.98
7.3.100.0100.00414.89
7.3.90.0070.00514.83
7.3.80.0070.00614.90
7.3.70.0080.00614.84
7.3.60.0050.00714.77
7.3.50.0110.00514.90
7.3.40.0080.00714.84
7.3.30.0070.00914.75
7.3.20.0050.00616.50
7.3.10.0050.00816.63
7.3.00.0050.00916.66
7.2.330.0180.00716.71
7.2.320.0110.00616.77
7.2.310.0110.01116.69
7.2.300.0070.01016.68
7.2.290.0060.01216.78
7.2.260.0100.01015.04
7.2.250.0070.00615.06
7.2.240.0050.01115.12
7.2.230.0070.00814.97
7.2.220.0080.00815.00
7.2.210.0060.01115.16
7.2.200.0050.00915.10
7.2.190.0060.00714.99
7.2.180.0080.00715.13
7.2.170.0070.00915.13
7.2.160.0020.01315.11
7.2.150.0110.00617.03
7.2.140.0030.01316.84
7.2.130.0100.00417.01
7.2.120.0060.00916.88
7.2.110.0070.00517.07
7.2.100.0090.00616.87
7.2.90.0060.00816.88
7.2.80.0040.01216.93
7.2.70.0090.00716.99
7.2.60.0060.00916.94
7.2.50.0010.01016.98
7.2.40.0060.00817.04
7.2.30.0030.01016.96
7.2.20.0090.00616.98
7.2.10.0060.00816.89
7.2.00.0060.00817.08
7.1.330.0050.00815.81
7.1.320.0090.00715.88
7.1.310.0060.00815.66
7.1.300.0050.00915.85
7.1.290.0030.00815.90
7.1.280.0070.00815.69
7.1.270.0060.00715.88
7.1.260.0100.00215.75
7.1.250.0080.00615.89
7.1.240.0050.00815.79
7.1.230.0080.00615.75
7.1.220.0040.00615.86
7.1.210.0040.00715.81
7.1.200.0040.01115.84
7.1.190.0030.00915.83
7.1.180.0020.01215.93
7.1.170.0060.00915.94
7.1.160.0080.00715.90
7.1.150.0030.00815.91
7.1.140.0060.01015.84
7.1.130.0040.00915.84
7.1.120.0070.00415.82
7.1.110.0060.00615.73
7.1.100.0090.00515.99
7.1.90.0020.01115.87
7.1.80.0060.00516.04
7.1.70.0060.00516.14
7.1.60.0050.00716.18
7.1.50.0170.00621.46
7.1.40.0150.00621.37
7.1.30.0130.01321.30
7.1.20.0150.00721.26
7.1.10.0140.00515.48
7.1.00.0080.01015.44
7.0.330.0060.00415.42
7.0.320.0050.00515.52
7.0.310.0050.01015.41
7.0.300.0100.00415.30
7.0.290.0090.00515.45
7.0.280.0030.01015.28
7.0.270.0050.00715.21
7.0.260.0080.00515.47
7.0.250.0050.01115.46
7.0.240.0020.00915.45
7.0.230.0070.00815.63
7.0.220.0050.00715.40
7.0.210.0030.00815.27
7.0.200.0060.00815.86
7.0.190.0130.00715.10
7.0.180.0110.01015.13
7.0.170.0090.00815.06
7.0.160.0100.00915.16
7.0.150.0140.00715.00
7.0.140.0090.00715.17
7.0.130.0050.01215.14
7.0.120.0110.00615.25
7.0.110.0060.00915.07
7.0.100.0100.00815.00
7.0.90.0080.00915.08
7.0.80.0100.00714.98
7.0.70.0090.00614.99
7.0.60.0090.01014.95
7.0.50.0100.00615.15
7.0.40.0390.01213.91
7.0.30.0070.01113.92
7.0.20.0050.01113.90
7.0.10.0070.00913.90
7.0.00.0140.00713.84
5.6.400.0080.00414.32
5.6.390.0070.01014.03
5.6.380.0080.00614.33
5.6.370.0040.01414.69
5.6.360.0070.01014.45
5.6.350.0040.01114.58
5.6.340.0000.01414.66
5.6.330.0110.00313.92
5.6.320.0030.01314.62
5.6.310.0030.00914.40
5.6.300.0000.01214.39
5.6.290.0070.00714.47
5.6.280.0030.00614.12
5.6.270.0070.00714.51
5.6.260.0090.00614.55
5.6.250.0030.00714.49
5.6.240.0100.00314.43
5.6.230.0030.01414.41
5.6.220.0060.01014.20
5.6.210.0100.00314.57
5.6.200.0100.00314.50
5.6.190.0060.00314.47
5.6.180.0070.00714.41
5.6.170.0070.00714.52
5.6.160.0120.00314.38
5.6.150.0030.01314.48
5.6.140.0060.01514.46
5.6.130.0040.01214.51
5.6.120.0060.01014.67
5.6.110.0040.00814.19
5.6.100.0070.00714.50
5.6.90.0000.01414.13
5.6.80.0080.00814.03
5.6.70.0130.00014.25
5.6.60.0070.00314.05
5.6.50.0060.00614.26
5.6.40.0040.01114.31
5.6.30.0000.01414.28
5.6.20.0070.01114.31
5.6.10.0040.00714.63
5.6.00.0030.01014.48

preferences:
30.15 ms | 403 KiB | 5 Q