3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myarray = array(array( "TICKETPRICE" => "6.0000", "QUANTITY" => "2", "COUNTRYID" => "15" ), array( "TICKETPRICE" => "4.0000", "QUANTITY" => "3", "COUNTRYID" => "9" )); $output = array(); foreach ($myarray as $array) { $qty = $array['QUANTITY']; unset($array['QUANTITY']); $output[] = array_fill(0, $qty, $array); } echo json_encode($output) . "\n"; $output = array(); foreach ($myarray as $array) { $qty = $array['QUANTITY']; unset($array['QUANTITY']); $output = array_merge($output, array_fill(0, $qty, $array)); } echo json_encode($output);

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.30.0080.00819.55
8.5.20.0140.01019.18
8.5.10.0100.00716.59
8.5.00.0110.01120.05
8.4.180.0120.01019.64
8.4.170.0110.00923.94
8.4.160.0050.00523.00
8.4.150.0070.00516.90
8.4.140.0120.00517.39
8.4.130.0140.00617.81
8.4.120.0140.00620.61
8.4.110.0140.00622.54
8.4.100.0110.01017.63
8.4.90.0140.00722.38
8.4.80.0070.00618.00
8.4.70.0110.00917.97
8.4.60.0090.01018.85
8.4.50.0130.00622.56
8.4.40.0070.01322.27
8.4.30.0130.00617.43
8.4.20.0030.01620.70
8.4.10.0060.00317.96
8.3.300.0080.01220.56
8.3.290.0120.00920.85
8.3.280.0100.01118.52
8.3.270.0120.00716.36
8.3.260.0090.00716.61
8.3.250.0050.00421.10
8.3.240.0160.00316.73
8.3.230.0100.01016.59
8.3.220.0150.00319.03
8.3.210.0130.00518.38
8.3.200.0040.00416.63
8.3.190.0070.00617.16
8.3.180.0110.00716.52
8.3.170.0110.00717.30
8.3.160.0040.00418.13
8.3.150.0100.01016.75
8.3.140.0040.00417.13
8.3.130.0070.01118.23
8.3.120.0050.00520.98
8.3.110.0070.00320.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0030.00617.97
8.3.70.0070.01116.63
8.3.60.0070.01118.18
8.3.50.0090.00618.03
8.3.40.0060.01218.93
8.3.30.0120.00318.83
8.3.20.0040.00421.69
8.3.10.0040.00423.56
8.3.00.0080.00023.66
8.2.300.0160.00418.04
8.2.290.0070.01020.64
8.2.280.0120.00618.52
8.2.270.0120.00617.09
8.2.260.0080.01216.84
8.2.250.0080.00018.36
8.2.240.0060.00317.32
8.2.230.0080.00022.58
8.2.220.0050.00537.54
8.2.210.0080.00026.77
8.2.200.0030.00618.29
8.2.190.0070.00716.63
8.2.180.0160.00318.31
8.2.170.0000.01522.96
8.2.160.0070.00720.10
8.2.150.0070.00024.18
8.2.140.0070.01024.66
8.2.130.0070.00018.09
8.2.120.0070.00026.35
8.2.110.0070.00320.89
8.2.100.0030.00917.91
8.2.90.0030.00619.34
8.2.80.0080.00017.97
8.2.70.0050.00317.50
8.2.60.0080.00317.68
8.2.50.0000.00818.07
8.2.40.0050.00318.35
8.2.30.0000.00718.18
8.2.20.0000.00718.10
8.2.10.0000.00819.23
8.2.00.0040.00419.30
8.1.340.0120.00817.76
8.1.330.0090.00922.08
8.1.320.0120.00616.16
8.1.310.0070.00018.59
8.1.300.0030.00619.74
8.1.290.0080.00330.84
8.1.280.0170.00325.92
8.1.270.0040.00420.73
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0040.00722.11
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0060.00317.25
8.1.180.0060.00318.10
8.1.170.0080.00018.51
8.1.160.0040.00418.92
8.1.150.0040.00418.91
8.1.140.0000.00720.68
8.1.130.0030.00621.91
8.1.120.0070.00017.49
8.1.110.0030.00717.54
8.1.100.0040.00417.38
8.1.90.0040.00417.53
8.1.80.0080.00017.34
8.1.70.0000.00817.48
8.1.60.0060.00317.57
8.1.50.0000.00817.54
8.1.40.0080.00017.49
8.1.30.0000.00817.65
8.1.20.0040.00417.66
8.1.10.0050.00217.58
8.1.00.0040.00417.44
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0000.00718.37
8.0.270.0030.00317.29
8.0.260.0030.00318.46
8.0.250.0000.00716.87
8.0.240.0000.00716.92
8.0.230.0050.00316.95
8.0.220.0080.00016.95
8.0.210.0040.00416.94
8.0.200.0000.00717.01
8.0.190.0040.00416.99
8.0.180.0040.00416.94
8.0.170.0030.00716.98
8.0.160.0040.00416.93
8.0.150.0050.00216.86
8.0.140.0040.00416.89
8.0.130.0050.00013.34
8.0.120.0040.00416.88
8.0.110.0040.00416.95
8.0.100.0070.00016.75
8.0.90.0030.00516.94
8.0.80.0100.00716.97
8.0.70.0000.00716.76
8.0.60.0000.00716.77
8.0.50.0080.00016.80
8.0.30.0070.01716.99
8.0.20.0150.00516.99
8.0.10.0030.00516.97
8.0.00.0100.00916.71
7.4.330.0050.00015.55
7.4.320.0000.00716.61
7.4.300.0060.00016.51
7.4.290.0030.00616.59
7.4.280.0040.00416.52
7.4.270.0030.00316.43
7.4.260.0000.00816.64
7.4.250.0030.00616.50
7.4.240.0030.00316.45
7.4.230.0000.00716.62
7.4.220.0000.00816.45
7.4.210.0080.00916.54
7.4.200.0070.00016.63
7.4.160.0080.00716.55
7.4.140.0100.00817.86
7.4.130.0060.01016.40
7.4.120.0040.01416.35
7.4.110.0130.01016.50
7.4.100.0090.01116.55
7.4.90.0030.01316.57
7.4.80.0050.01119.39
7.4.70.0100.00716.56
7.4.60.0140.00316.29
7.4.50.0110.00716.60
7.4.40.0090.01316.41
7.4.00.0030.01014.75
7.3.330.0000.00613.09
7.3.320.0000.00613.09
7.3.310.0040.00416.34
7.3.300.0000.00716.18
7.3.290.0000.00716.30
7.3.280.0070.00716.28
7.3.260.0090.00816.39
7.3.240.0130.00616.53
7.3.230.0100.00616.48
7.3.210.0100.00616.41
7.3.200.0110.00816.65
7.3.190.0150.00916.53
7.3.180.0110.00716.29
7.3.170.0070.01016.64
7.3.160.0100.01016.50
7.3.10.0310.00515.74
7.3.00.0300.00615.68
7.2.330.0120.00616.45
7.2.320.0130.00616.79
7.2.310.0140.00316.42
7.2.300.0160.00416.51
7.2.290.0080.01016.73
7.2.130.0350.00615.98
7.2.120.0420.01015.90
7.2.110.0340.01116.04
7.2.100.0330.01115.84
7.2.90.0820.00615.78
7.2.80.0360.00715.85
7.2.70.0390.01215.96
7.2.60.0370.00515.98
7.2.50.0370.00915.72
7.2.40.0280.00615.80
7.2.30.0250.00815.93
7.2.20.0330.00515.79
7.2.10.0450.00415.85
7.2.00.0390.00515.70
7.1.250.0360.00914.66

preferences:
45.8 ms | 1446 KiB | 5 Q