3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc_arr = array("second" => array( array("position" => 4, "content" => "Valiant"), array("position" => 5, "content" => "Hail") ), "first" => array( array("position" => 0, "content" => "Hail"), array("position" => 3, "content" => "Victors"), array("position" => 2, "content" => "the"), array("position" => 1, "content" => "to") ) ); $order = array('first','second'); $arr = array(); foreach($order as $ord) { if(isset($assoc_arr[$ord])) { $arr = array_merge($arr, $assoc_arr[$ord]); } } print_r($arr);

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.0150.00418.18
8.3.50.0080.01021.88
8.3.40.0070.00718.84
8.3.30.0070.00718.89
8.3.20.0000.00720.34
8.3.10.0060.00322.10
8.3.00.0040.00422.39
8.2.180.0070.01416.38
8.2.170.0070.01022.96
8.2.160.0100.00720.93
8.2.150.0080.00024.18
8.2.140.0120.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.49
8.2.110.0080.00022.29
8.2.100.0080.00417.91
8.2.90.0040.00419.21
8.2.80.0000.00817.97
8.2.70.0040.00417.48
8.2.60.0030.00618.05
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0040.00418.19
8.2.20.0090.00017.73
8.2.10.0000.00817.63
8.2.00.0040.00417.74
8.1.280.0080.00825.92
8.1.270.0000.00823.97
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0090.00023.73
8.1.230.0040.00719.10
8.1.220.0050.00317.77
8.1.210.0060.00318.77
8.1.200.0030.00717.23
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0080.00018.64
8.1.160.0070.00022.00
8.1.150.0070.00018.61
8.1.140.0030.00517.39
8.1.130.0000.00817.86
8.1.120.0030.00417.38
8.1.110.0040.00417.50
8.1.100.0060.00317.47
8.1.90.0000.00717.43
8.1.80.0000.00817.37
8.1.70.0000.00817.42
8.1.60.0000.00817.57
8.1.50.0070.00017.54
8.1.40.0040.00417.41
8.1.30.0000.00817.68
8.1.20.0000.00817.68
8.1.10.0000.00717.46
8.1.00.0040.00417.49
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0040.00418.45
8.0.270.0050.00217.18
8.0.260.0030.00316.82
8.0.250.0040.00416.88
8.0.240.0040.00416.94
8.0.230.0000.00716.81
8.0.220.0070.00016.86
8.0.210.0030.00316.84
8.0.200.0070.00016.99
8.0.190.0000.00716.93
8.0.180.0000.00716.90
8.0.170.0040.00416.93
8.0.160.0030.00816.85
8.0.150.0040.00416.79
8.0.140.0000.00716.88
8.0.130.0000.00513.32
8.0.120.0000.00816.86
8.0.110.0000.00716.83
8.0.100.0040.00416.75
8.0.90.0040.00416.72
8.0.80.0090.01216.86
8.0.70.0000.00716.69
8.0.60.0040.00416.75
8.0.50.0000.00716.72
8.0.30.0130.00616.95
8.0.20.0120.00617.40
8.0.10.0070.00017.08
8.0.00.0130.00816.79
7.4.330.0020.00215.00
7.4.320.0030.00316.53
7.4.300.0000.00616.61
7.4.290.0030.00316.49
7.4.280.0000.00716.48
7.4.270.0030.00316.69
7.4.260.0030.00316.50
7.4.250.0000.00716.32
7.4.240.0040.00416.60
7.4.230.0030.00316.60
7.4.220.0060.01316.46
7.4.210.0130.00116.61
7.4.200.0040.00416.70
7.4.190.0030.00316.70
7.4.160.0040.01116.61
7.4.150.0060.01217.40
7.4.140.0130.00417.86
7.4.130.0070.01216.48
7.4.120.0130.00416.52
7.4.110.0120.00916.59
7.4.100.0070.01016.45
7.4.90.0070.01016.46
7.4.80.0060.01119.39
7.4.70.0090.00616.32
7.4.60.0080.00816.42
7.4.50.0090.00016.31
7.4.40.0050.00722.77
7.4.30.0100.00916.49
7.4.00.0090.00615.00
7.3.330.0020.00213.12
7.3.320.0000.00513.01
7.3.310.0000.00716.21
7.3.300.0000.00716.29
7.3.290.0100.00616.30
7.3.280.0120.00516.25
7.3.270.0170.00617.40
7.3.260.0170.00016.62
7.3.250.0090.00816.38
7.3.240.0030.01416.48
7.3.230.0100.00716.55
7.3.210.0130.00316.64
7.3.200.0060.01219.39
7.3.190.0030.01416.55
7.3.180.0110.00716.22
7.3.170.0090.00616.30
7.3.160.0100.00616.47
7.3.120.0030.01415.04
7.2.330.0040.01216.34
7.2.320.0040.01516.51
7.2.310.0070.01116.54
7.2.300.0030.01216.74
7.2.290.0030.01316.78
7.2.00.0060.00819.29
7.1.100.0040.00718.22
7.1.70.0130.00317.31
7.1.60.0100.01719.82
7.1.50.0180.00316.91
7.1.00.0030.07722.38
7.0.200.0080.00416.78
7.0.140.0070.07022.00
7.0.60.0070.08719.93
7.0.50.0030.08717.84
7.0.40.0070.05720.26
7.0.30.0230.08720.13
7.0.20.0270.04720.09
7.0.10.0070.08320.17
7.0.00.0130.05320.05
5.6.280.0070.07021.12
5.6.210.0030.08320.60
5.6.200.0100.07318.27
5.6.190.0170.06720.33
5.6.180.0100.03720.49
5.6.170.0300.07020.58
5.6.160.0030.04320.41
5.6.150.0030.08318.17
5.6.140.0030.04718.14
5.6.130.0130.04018.17
5.6.120.0100.06321.14
5.6.110.0070.08721.02
5.6.100.0100.07021.13
5.6.90.0070.08320.99
5.6.80.0100.04720.50
5.5.350.0070.06720.41
5.5.340.0100.08318.07
5.5.330.0100.07720.34
5.5.320.0230.09020.35
5.5.310.0300.04320.18
5.5.300.0070.08017.94
5.5.290.0070.08318.00
5.5.280.0000.04320.87
5.5.270.0170.07720.88
5.5.260.0000.08320.79
5.5.250.0130.07720.69
5.5.240.0000.05020.18
5.4.450.0230.04719.54
5.4.440.0530.05319.46
5.4.430.0700.04319.29
5.4.420.0530.03719.41
5.4.410.0100.05318.86
5.4.400.0170.04718.72
5.4.390.0100.05318.83
5.4.380.0200.04718.62
5.4.370.0230.05018.59
5.4.360.0170.05718.50
5.4.350.0270.04718.76
5.4.340.0230.05018.76
5.4.320.0070.04112.49
5.4.310.0070.04212.48
5.4.300.0080.04512.48
5.4.290.0130.03812.48
5.4.280.0050.03612.38
5.4.270.0080.03712.35
5.4.260.0080.05912.35
5.4.250.0120.04312.35
5.4.240.0140.04812.35
5.4.230.0120.04812.34
5.4.220.0120.04612.34
5.4.210.0090.04712.34
5.4.200.0100.05412.34
5.4.190.0090.04812.34
5.4.180.0100.04512.34
5.4.170.0210.06212.35
5.4.160.0100.05512.34
5.4.150.0180.05912.34
5.4.140.0080.05612.02
5.4.130.0060.05112.01
5.4.120.0100.04711.97
5.4.110.0080.04911.96
5.4.100.0090.04711.96
5.4.90.0090.05311.96
5.4.80.0100.04811.96
5.4.70.0060.03511.96
5.4.60.0060.03911.96
5.4.50.0060.03711.96
5.4.40.0060.03611.95
5.4.30.0100.03411.95
5.4.20.0070.03711.95
5.4.10.0100.03311.95
5.4.00.0060.03911.44
5.3.290.0050.05112.80
5.3.280.0070.03912.71
5.3.270.0070.04012.72
5.3.260.0050.04212.71
5.3.250.0120.04612.72
5.3.240.0080.04512.72
5.3.230.0080.05512.71
5.3.220.0040.04212.68
5.3.210.0060.04212.68
5.3.200.0110.03512.68
5.3.190.0090.04312.68
5.3.180.0050.04212.67
5.3.170.0050.04012.67
5.3.160.0060.03712.68
5.3.150.0060.03812.68
5.3.140.0090.04412.66
5.3.130.0060.04112.66
5.3.120.0080.05112.66
5.3.110.0090.04712.66
5.3.100.0170.05012.12
5.3.90.0120.06112.09
5.3.80.0100.04412.08
5.3.70.0140.04712.07
5.3.60.0140.05412.07
5.3.50.0130.05312.00
5.3.40.0130.04012.00
5.3.30.0070.03511.95
5.3.20.0210.05311.73
5.3.10.0110.05611.69
5.3.00.0140.06211.68
5.2.170.0070.0429.18
5.2.160.0170.0539.19
5.2.150.0120.0409.18
5.2.140.0080.0549.18
5.2.130.0140.0519.14
5.2.120.0120.0429.14
5.2.110.0070.0409.14
5.2.100.0120.0489.14
5.2.90.0070.0279.14
5.2.80.0090.0319.13
5.2.70.0070.0299.13
5.2.60.0050.0319.09
5.2.50.0060.0309.06
5.2.40.0040.0369.04
5.2.30.0060.0379.01
5.2.20.0050.0399.00
5.2.10.0150.0318.91
5.2.00.0070.0318.77
5.1.60.0090.0298.05
5.1.50.0010.0308.05
5.1.40.0010.0308.04
5.1.30.0080.0248.39
5.1.20.0060.0268.41
5.1.10.0080.0238.13
5.1.00.0030.0288.13
5.0.50.0010.0246.61
5.0.40.0030.0226.47
5.0.30.0060.0326.29
5.0.20.0080.0236.26
5.0.10.0040.0286.23
5.0.00.0120.0526.23
4.4.90.0080.0354.78
4.4.80.0110.0364.75
4.4.70.0070.0404.75
4.4.60.0070.0294.76
4.4.50.0080.0174.77
4.4.40.0050.0324.71
4.4.30.0040.0234.76
4.4.20.0070.0204.85
4.4.10.0060.0204.85
4.4.00.0040.0284.76
4.3.110.0050.0214.67
4.3.100.0070.0204.66
4.3.90.0040.0174.64
4.3.80.0030.0314.58
4.3.70.0050.0164.63
4.3.60.0040.0144.63
4.3.50.0090.0194.62
4.3.40.0040.0284.54
4.3.30.0020.0163.29
4.3.20.0020.0173.28
4.3.10.0020.0163.23
4.3.00.0030.01015.05

preferences:
43.25 ms | 401 KiB | 5 Q