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) { $output[] = array_fill(0, $array['QUANTITY'], $array); } echo json_encode($output) . "\n"; $output = array(); foreach ($myarray as $array) { $output = array_merge($output, array_fill(0, $array['QUANTITY'], $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.0110.00719.62
8.5.20.0130.00519.61
8.5.10.0100.00916.54
8.5.00.0120.00920.00
8.4.180.0130.00922.08
8.4.170.0100.01023.88
8.4.160.0130.00823.82
8.4.150.0070.00616.96
8.4.140.0110.00917.69
8.4.130.0090.00717.84
8.4.120.0060.00322.13
8.4.110.0040.00518.70
8.4.100.0040.00417.83
8.4.90.0150.00520.46
8.4.80.0130.00618.84
8.4.70.0110.00518.81
8.4.60.0040.00520.43
8.4.50.0080.01319.36
8.4.40.0100.01020.55
8.4.30.0150.00619.39
8.4.20.0100.01020.42
8.4.10.0070.00417.66
8.3.300.0130.00818.35
8.3.290.0100.01320.81
8.3.280.0120.00818.44
8.3.270.0100.00916.86
8.3.260.0120.00916.36
8.3.250.0090.00818.95
8.3.240.0120.00716.63
8.3.230.0100.00916.81
8.3.220.0090.00519.17
8.3.210.0060.01016.81
8.3.200.0110.00816.56
8.3.190.0070.00517.19
8.3.180.0110.00816.55
8.3.170.0130.00618.96
8.3.160.0040.01118.35
8.3.150.0070.01120.83
8.3.140.0040.00416.71
8.3.130.0000.00816.80
8.3.120.0070.00219.18
8.3.110.0110.00416.73
8.3.100.0030.00624.06
8.3.90.0100.00026.77
8.3.80.0080.00417.97
8.3.70.0110.00716.63
8.3.60.0070.01318.31
8.3.50.0080.00817.97
8.3.40.0090.00618.84
8.3.30.0120.00418.84
8.3.20.0000.00822.08
8.3.10.0120.00623.36
8.3.00.0080.00023.66
8.2.300.0130.00718.12
8.2.290.0120.00620.37
8.2.280.0110.00518.35
8.2.270.0170.00317.28
8.2.260.0110.00418.89
8.2.250.0040.00418.30
8.2.240.0060.00318.73
8.2.230.0080.00020.94
8.2.220.0150.00037.54
8.2.210.0100.01026.77
8.2.200.0070.00318.29
8.2.190.0110.00416.75
8.2.180.0180.00316.38
8.2.170.0120.00322.96
8.2.160.0070.00720.20
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00326.16
8.2.120.0050.00220.94
8.2.110.0060.00322.02
8.2.100.0060.00618.03
8.2.90.0050.00317.88
8.2.80.0040.00417.97
8.2.70.0030.00518.00
8.2.60.0000.00817.91
8.2.50.0040.00418.10
8.2.40.0060.00319.22
8.2.30.0040.00419.35
8.2.20.0040.00418.26
8.2.10.0030.00619.19
8.2.00.0040.00419.16
8.1.340.0110.00919.91
8.1.330.0040.00622.16
8.1.320.0120.00817.95
8.1.310.0070.01016.66
8.1.300.0030.00720.03
8.1.290.0060.00618.88
8.1.280.0040.01125.92
8.1.270.0040.01123.90
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.97
8.1.230.0080.00417.77
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0030.00517.25
8.1.180.0090.00018.10
8.1.170.0000.00918.69
8.1.160.0000.00718.87
8.1.150.0000.00818.90
8.1.140.0040.00420.72
8.1.130.0030.00321.92
8.1.120.0030.00317.35
8.1.110.0060.00317.46
8.1.100.0050.00217.52
8.1.90.0040.00417.34
8.1.80.0040.00417.44
8.1.70.0030.00317.48
8.1.60.0040.00417.56
8.1.50.0000.00817.54
8.1.40.0080.00017.52
8.1.30.0000.00917.63
8.1.20.0000.00817.71
8.1.10.0090.00017.62
8.1.00.0040.00417.52
8.0.300.0000.00921.52
8.0.290.0040.00416.63
8.0.280.0070.00018.43
8.0.270.0040.00417.24
8.0.260.0060.00018.35
8.0.250.0030.00416.85
8.0.240.0070.00017.00
8.0.230.0030.00316.99
8.0.220.0050.00316.87
8.0.210.0000.00816.88
8.0.200.0000.00816.95
8.0.190.0040.00416.91
8.0.180.0000.00716.88
8.0.170.0030.00916.95
8.0.160.0040.00416.86
8.0.150.0000.00916.82
8.0.140.0040.00416.86
8.0.130.0060.00013.40
8.0.120.0040.00416.86
8.0.110.0000.00716.69
8.0.100.0040.00416.90
8.0.90.0070.00016.77
8.0.80.0120.00516.87
8.0.70.0050.00216.80
8.0.60.0000.00716.77
8.0.50.0030.00616.77
8.0.30.0080.01117.10
8.0.20.0100.01017.40
8.0.10.0060.00316.98
8.0.00.0080.01116.88
7.4.330.0000.00415.55
7.4.320.0000.00716.59
7.4.300.0030.00316.65
7.4.290.0000.00716.58
7.4.280.0050.00316.45
7.4.270.0000.00716.50
7.4.260.0070.00016.50
7.4.250.0000.00716.59
7.4.240.0000.00716.59
7.4.230.0040.00416.39
7.4.220.0040.00416.49
7.4.210.0090.00816.63
7.4.200.0080.00016.51
7.4.160.0070.00816.58
7.4.140.0110.01217.86
7.4.130.0120.00616.47
7.4.120.0140.00716.55
7.4.110.0130.01316.43
7.4.100.0150.00816.34
7.4.90.0090.00616.48
7.4.80.0100.00619.39
7.4.70.0080.00816.43
7.4.60.0070.01016.52
7.4.50.0090.00616.43
7.4.40.0180.00416.64
7.4.00.0040.01214.86
7.3.330.0030.00213.27
7.3.320.0030.00313.32
7.3.310.0000.00716.29
7.3.300.0030.00316.24
7.3.290.0000.00716.32
7.3.280.0070.00816.22
7.3.260.0130.00616.43
7.3.240.0080.01116.42
7.3.230.0090.00916.62
7.3.210.0070.01016.35
7.3.200.0080.01216.33
7.3.190.0090.00916.45
7.3.180.0000.01716.28
7.3.170.0100.00716.40
7.3.160.0090.00616.67
7.3.120.0060.01215.00
7.3.110.0130.00314.52
7.3.100.0070.00714.64
7.3.90.0030.01314.92
7.3.80.0040.00714.80
7.3.70.0030.00614.89
7.3.60.0110.00314.64
7.3.50.0100.00614.61
7.3.40.0060.00614.95
7.3.30.0090.00614.82
7.3.20.0030.00616.70
7.3.10.0350.00615.27
7.3.00.0190.01115.74
7.2.330.0060.01016.49
7.2.320.0160.00616.87
7.2.310.0160.00016.55
7.2.300.0080.00816.76
7.2.290.0070.01116.80
7.2.250.0070.01114.93
7.2.240.0130.00715.29
7.2.230.0100.00014.66
7.2.220.0030.00615.04
7.2.210.0000.01315.17
7.2.200.0040.00814.99
7.2.190.0090.00614.79
7.2.180.0100.00615.14
7.2.170.0070.00715.13
7.2.130.0400.00715.08
7.2.120.0420.00015.19
7.2.110.0440.00615.05
7.2.100.0410.00315.28
7.2.90.0470.00615.15
7.2.80.0480.01014.91
7.2.70.1600.00015.18
7.2.60.0400.00714.79
7.2.50.0400.01015.12
7.2.40.0300.00315.11
7.2.30.0370.01015.31
7.2.20.0330.00715.05
7.2.10.0320.00315.02
7.2.00.0390.00715.29
7.1.330.0100.00315.56
7.1.320.0090.00615.96
7.1.310.0070.00715.94
7.1.300.0070.00715.41
7.1.290.0070.00315.65
7.1.280.0030.01015.95
7.1.270.0040.00915.88
7.1.260.0080.00315.77
7.1.250.0440.00313.98

preferences:
122.95 ms | 1614 KiB | 5 Q