3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = json_decode('{"queryNum":1,"profileName":"Bank of Hawaii 1","profileID":"3790328098","metricSetNum":1,"subQueryNum":1,"iterationNum":1,"status":"SUCCESS","sampled":false,"totalResults":17,"columnHeadersArr":{"dim1_1":"Headline 1","dim2_1":"Headline 2","dim3_1":"Description","met1_1":"Impressions","met2_1":"Clicks","met3_1":"Clicks","met3_2":"Impressions","met4_1":"Cost","met4_2":"Clicks","met5_1":"Cost","met6_1":"Conversions","met7_1":"Cost","met7_2":"Conversions","met8_1":"Conversions","met8_2":"Clicks","met_f1_1":"Clicks"},"rows":{"|BOH Checking Account|Bank on the Go|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":13573,"met2_1":3151,"met3_1":23.21520666028144,"met4_1":0.5270168200571248,"met5_1":1660.63,"met6_1":"164","met7_1":10.12579268292683,"met8_1":5.204696921612187},"|BOH Checking Account|Bank on the Go|Convenience checking plus online & mobile banking. Apply now!":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Convenience checking plus online & mobile banking. Apply now!","met1_1":3916,"met2_1":568,"met3_1":14.504596527068436,"met4_1":0.6359330985915492,"met5_1":361.21,"met6_1":"9","met7_1":40.13444444444444,"met8_1":1.584507042253521},"|Bank on the Go|BOH Checking Account|Convenience checking plus online & mobile banking.":{"dim1_1":"Bank on the Go","dim2_1":"BOH Checking Account","dim3_1":"Convenience checking plus online & mobile banking.","met1_1":"762","met2_1":"156","met3_1":20.47244094488189,"met4_1":0.5787820512820513,"met5_1":90.29,"met6_1":"11.00","met7_1":8.208181818181819,"met8_1":7.051282051282051},"|BOH Checking Account|Bank on the Go|Convenience checking plus online & mobile banking.":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Convenience checking plus online & mobile banking.","met1_1":"13027","met2_1":"1376","met3_1":10.562677515928456,"met4_1":1.0944767441860466,"met5_1":1506,"met6_1":"57.00","met7_1":26.42105263157895,"met8_1":4.142441860465116},"|Bank on the Go|BOH Checking Account|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"Bank on the Go","dim2_1":"BOH Checking Account","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":454,"met2_1":97,"met3_1":21.365638766519822,"met4_1":0.34628865979381446,"met5_1":33.59,"met6_1":"1.00","met7_1":33.59,"met8_1":1.0309278350515463},"|BOH Online Checking Account|Bank on the Go|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"BOH Online Checking Account","dim2_1":"Bank on the Go","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":"266","met2_1":"45","met3_1":16.917293233082706,"met4_1":0.526,"met5_1":23.67,"met6_1":"0.00","met7_1":"","met8_1":0}}}',true); $sortArr = json_decode('{"inQuerySort":{"field":"ConversionRateManyPerClick_perc","direction":"desc","fieldType":"met"},"sortOrig":{"field":"ConversionRateManyPerClick_perc_desc;2nd:Clicks_desc","direction":""},"auto":false,"secondary":{"direction":"desc","field":"Clicks","fieldType":"met","inQuerySort":{"field":"Clicks","direction":"desc","fieldType":"met"},"col":"met2_1"},"intention":"custom","field":"ConversionRateManyPerClick_perc","direction":"desc","fieldType":"met","col":"met8_1"}',true); $sortValuesArr = []; foreach ($results["rows"] as $key => &$row) { $sortValuesArr["first"][$key] = $row[$sortArr["col"]]; $sortValuesArr["second"][$key] = ($sortArr["secondary"]["col"] ? $row[$sortArr["secondary"]["col"]] : ""); } array_multisort( $sortValuesArr["first"], ($sortArr["direction"] == "desc" ? SORT_DESC : SORT_ASC), ($sortArr["fieldType"] == "dim" ? SORT_NATURAL : SORT_NUMERIC), $sortValuesArr["second"], ($sortArr["secondary"]["direction"] == "desc" ? SORT_DESC : SORT_ASC), ($sortArr["secondary"]["fieldType"] == "dim" ? SORT_NATURAL : SORT_NUMERIC), $results["rows"] ); var_dump($sortValuesArr); $ar1 = array(10, 100, 100, 0); $ar2 = array(1, 3, 2, 4); array_multisort($ar1, $ar2); var_dump($ar1); var_dump($ar2);

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.60.0160.00318.55
8.3.50.0040.01418.07
8.3.40.0000.01718.84
8.3.30.0090.00618.61
8.3.20.0030.00519.34
8.3.10.0050.00323.65
8.3.00.0000.00720.68
8.2.180.0070.00718.29
8.2.170.0150.00022.96
8.2.160.0180.00320.45
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00319.78
8.2.120.0080.00026.35
8.2.110.0060.00320.93
8.2.100.0030.00917.84
8.2.90.0040.00417.75
8.2.80.0030.00517.97
8.2.70.0080.00018.03
8.2.60.0050.00318.34
8.2.50.0000.00818.10
8.2.40.0000.00719.38
8.2.30.0000.00719.31
8.2.20.0070.00018.20
8.2.10.0000.00818.03
8.2.00.0040.00417.67
8.1.280.0120.00325.92
8.1.270.0080.00018.82
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.58
8.1.230.0040.00722.08
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0090.00017.35
8.1.180.0040.00418.10
8.1.170.0030.00518.47
8.1.160.0000.00818.84
8.1.150.0000.00718.84
8.1.140.0070.00022.28
8.1.130.0000.00717.47
8.1.120.0050.00217.53
8.1.110.0050.00317.48
8.1.100.0040.00417.37
8.1.90.0070.00017.54
8.1.80.0060.00317.48
8.1.70.0040.00417.41
8.1.60.0040.00417.53
8.1.50.0030.00517.59
8.1.40.0080.00017.54
8.1.30.0090.00317.62
8.1.20.0000.00817.71
8.1.10.0060.00317.61
8.1.00.0030.00517.40
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0040.00418.55
8.0.270.0030.00317.29
8.0.260.0030.00316.76
8.0.250.0070.00016.91
8.0.240.0040.00416.92
8.0.230.0070.00016.86
8.0.220.0000.00716.82
8.0.210.0000.00716.96
8.0.200.0060.00016.94
8.0.190.0000.00816.95
8.0.180.0040.00416.80
8.0.170.0060.00316.82
8.0.160.0050.00216.83
8.0.150.0000.00716.86
8.0.140.0000.00916.87
8.0.130.0000.00613.40
8.0.120.0040.00416.90
8.0.110.0000.00716.72
8.0.100.0070.00016.92
8.0.90.0030.00616.93
8.0.80.0110.00816.90
8.0.70.0000.00816.96
8.0.60.0020.00516.86
8.0.50.0080.00016.84
8.0.30.0100.00917.15
8.0.20.0030.01717.40
8.0.10.0000.00717.06
8.0.00.0080.01316.75
7.4.330.0000.00515.55
7.4.320.0030.00316.67
7.4.300.0000.00616.53
7.4.290.0000.00716.52
7.4.280.0000.00916.52
7.4.270.0000.00816.59
7.4.260.0040.00416.63
7.4.250.0040.00416.49
7.4.240.0000.00716.61
7.4.230.0070.00016.61
7.4.220.0040.00416.61
7.4.210.0100.00716.64
7.4.200.0000.00716.51
7.4.160.0140.00416.45
7.4.140.0110.00917.86
7.4.130.0100.01116.44
7.4.120.0110.00716.58
7.4.110.0030.01816.55
7.4.100.0070.01116.59
7.4.90.0130.00716.38
7.4.80.0070.01319.39
7.4.70.0080.00816.43
7.4.60.0000.01516.39
7.4.50.0030.00716.68
7.4.40.0060.01216.43
7.4.00.0080.01015.13
7.3.330.0050.00013.27
7.3.320.0050.00013.19
7.3.310.0100.00016.32
7.3.300.0000.00716.24
7.3.290.0070.00016.20
7.3.280.0100.01016.31
7.3.260.0100.01116.40
7.3.240.0110.00916.44
7.3.230.0090.01216.45
7.3.210.0160.00316.37
7.3.200.0070.01116.40
7.3.190.0110.00716.55
7.3.180.0070.01016.27
7.3.170.0060.01616.33
7.3.160.0040.01416.44
7.3.120.0070.01014.63
7.3.110.0100.00714.90
7.3.100.0070.01014.79
7.3.90.0090.00914.96
7.3.80.0070.00315.05
7.3.70.0090.00614.65
7.3.60.0060.00614.87
7.3.50.0070.00315.04
7.3.40.0100.00314.92
7.3.30.0070.00715.03
7.3.20.0070.00416.38
7.3.10.0080.00816.76
7.3.00.0060.00816.61
7.2.330.0140.00916.48
7.2.320.0150.01016.73
7.2.310.0100.01316.90
7.2.300.0160.00616.73
7.2.290.0170.00316.47
7.2.250.0100.00714.72
7.2.240.0130.00615.11
7.2.230.0030.01315.23
7.2.220.0070.00715.34
7.2.210.0090.00615.04
7.2.200.0090.00314.91
7.2.190.0030.01015.03
7.2.180.0060.00615.18
7.2.170.0000.01815.18
7.2.130.0080.00416.98
7.2.120.0060.00617.03
7.2.110.0110.00916.63
7.2.100.0110.00516.79
7.2.90.0040.01016.72
7.2.80.0190.00715.88
7.2.70.0060.01216.93
7.2.60.0140.00515.89
7.2.50.0100.01016.04
7.2.40.0140.00716.94
7.2.30.0070.00717.04
7.2.20.0100.00516.75
7.2.10.0030.01316.86
7.2.00.0090.00816.96
7.1.330.0030.01015.74
7.1.320.0070.01116.04
7.1.310.0070.01015.76
7.1.300.0100.00615.69
7.1.290.0030.01015.57
7.1.280.0060.01015.86
7.1.270.0030.01015.98
7.1.260.0030.01015.57
7.1.250.0040.00715.81
7.1.230.0060.00615.71
7.1.220.0040.00815.79
7.1.210.0080.00815.71
7.1.200.0200.00715.75
7.1.190.0220.00613.83
7.1.180.0030.00915.50
7.1.170.0130.01214.13
7.1.160.0090.00315.86
7.1.150.0060.01115.87
7.1.140.0120.00515.82
7.1.130.0050.01015.48
7.1.120.0000.01615.45
7.1.110.0060.01015.81
7.1.100.0030.00916.00
7.1.90.0100.00615.50
7.1.80.0130.00315.81
7.1.70.0080.00515.58
7.1.60.0180.01833.50
7.1.50.0340.00733.91
7.1.40.0300.00633.42
7.1.30.0330.00033.66
7.1.20.0210.01033.46
7.1.10.0080.00815.64
7.1.00.0080.00815.89
5.6.380.0030.01314.29

preferences:
63.27 ms | 401 KiB | 5 Q