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]); } } $finalArray = array(); $proceed = true; $i = 0; foreach($arr as $a) { $finalArray[$a['position']] = $a['content']; } ksort($finalArray); print_r($finalArray);

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.0120.00618.55
8.3.50.0110.00922.00
8.3.40.0140.00718.72
8.3.30.0110.00419.08
8.3.20.0040.00420.34
8.3.10.0060.00322.09
8.3.00.0080.00022.38
8.2.180.0130.00616.38
8.2.170.0060.00922.96
8.2.160.0070.01021.07
8.2.150.0040.00424.18
8.2.140.0120.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00019.48
8.2.110.0030.00621.13
8.2.100.0040.00817.97
8.2.90.0040.00417.88
8.2.80.0090.00018.05
8.2.70.0000.00817.93
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0090.00019.35
8.2.30.0050.00317.75
8.2.20.0000.00717.71
8.2.10.0040.00417.74
8.2.00.0040.00417.68
8.1.280.0200.00025.92
8.1.270.0000.00824.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.20
8.1.230.0000.01220.99
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0090.00317.48
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0000.00718.89
8.1.150.0030.00518.68
8.1.140.0040.00417.44
8.1.130.0000.00717.83
8.1.120.0000.00717.48
8.1.110.0070.00017.49
8.1.100.0030.00517.49
8.1.90.0000.00717.33
8.1.80.0000.00717.33
8.1.70.0000.00717.45
8.1.60.0050.00317.47
8.1.50.0050.00217.49
8.1.40.0040.00417.47
8.1.30.0030.00617.54
8.1.20.0000.00817.72
8.1.10.0040.00417.50
8.1.00.0080.00017.37
8.0.300.0040.00420.12
8.0.290.0040.00416.75
8.0.280.0000.00717.91
8.0.270.0000.00717.93
8.0.260.0040.00416.82
8.0.250.0030.00316.92
8.0.240.0000.00716.85
8.0.230.0040.00416.94
8.0.220.0040.00416.95
8.0.210.0000.00816.91
8.0.200.0000.00716.86
8.0.190.0000.00816.96
8.0.180.0050.00316.93
8.0.170.0000.00716.85
8.0.160.0030.00716.72
8.0.150.0030.00516.96
8.0.140.0030.00316.81
8.0.130.0030.00313.32
8.0.120.0040.00416.82
8.0.110.0070.00016.80
8.0.100.0000.00716.79
8.0.90.0000.00716.96
8.0.80.0060.00916.91
8.0.70.0000.00816.79
8.0.60.0040.00416.89
8.0.50.0000.00716.85
8.0.30.0100.01117.06
8.0.20.0100.00817.40
8.0.10.0040.00416.85
8.0.00.0080.00916.75
7.4.330.0000.00615.09
7.4.320.0000.00616.59
7.4.300.0040.00416.57
7.4.290.0000.00716.50
7.4.280.0030.00316.40
7.4.270.0000.00716.59
7.4.260.0050.00316.40
7.4.250.0090.00016.63
7.4.240.0050.00316.59
7.4.230.0000.00716.58
7.4.220.0120.00616.53
7.4.210.0040.01016.55
7.4.200.0020.00516.61
7.4.190.0070.00016.72
7.4.160.0080.00816.49
7.4.150.0060.01117.40
7.4.140.0120.00717.86
7.4.130.0100.00716.54
7.4.120.0110.01016.51
7.4.110.0060.01516.54
7.4.100.0110.00716.69
7.4.90.0180.00016.34
7.4.80.0110.00519.39
7.4.70.0100.00616.28
7.4.60.0100.00616.51
7.4.50.0030.00316.63
7.4.40.0110.00422.77
7.4.30.0100.00616.43
7.4.00.0070.00914.97
7.3.330.0000.00613.07
7.3.320.0050.00013.16
7.3.310.0000.00716.14
7.3.300.0030.00316.23
7.3.290.0100.00316.36
7.3.280.0060.01016.33
7.3.270.0100.00717.40
7.3.260.0120.00616.48
7.3.250.0100.00816.59
7.3.240.0030.01316.54
7.3.230.0100.00916.55
7.3.210.0100.00716.43
7.3.200.0090.01019.39
7.3.190.0060.01016.49
7.3.180.0160.00616.63
7.3.170.0080.00816.28
7.3.160.0100.01216.27
7.3.120.0060.00814.94
7.3.110.0090.00914.88
7.3.100.0040.01414.64
7.3.90.0030.01314.70
7.3.80.0000.01114.59
7.3.70.0030.01014.74
7.3.60.0030.01014.72
7.3.50.0000.01114.81
7.3.40.0040.00814.88
7.3.30.0030.01014.81
7.3.20.0050.00416.66
7.3.10.0050.00616.54
7.3.00.0080.01016.66
7.2.330.0060.01016.84
7.2.320.0040.01516.68
7.2.310.0060.01216.61
7.2.300.0090.00616.85
7.2.290.0060.01116.64
7.2.250.0040.01115.11
7.2.240.0120.00615.25
7.2.230.0040.01115.33
7.2.220.0060.01014.99
7.2.210.0070.00715.23
7.2.200.0060.00614.84
7.2.190.0030.01215.02
7.2.180.0060.00615.02
7.2.170.0030.01015.09
7.2.160.0070.01014.95
7.2.150.0070.00716.82
7.2.140.0090.00316.77
7.2.130.0040.00616.90
7.2.120.0070.01016.91
7.2.110.0050.00916.86
7.2.100.0080.00316.88
7.2.90.0050.00716.88
7.2.80.0100.00517.14
7.2.70.0090.01116.88
7.2.60.0040.01117.00
7.2.50.0020.01316.91
7.2.40.0080.00716.98
7.2.30.0100.00716.94
7.2.20.0090.00416.90
7.2.10.0050.00916.89
7.2.00.0110.00017.09
7.1.330.0030.01015.71
7.1.320.0060.00615.89
7.1.310.0070.00715.67
7.1.300.0180.00015.67
7.1.290.0080.00415.89
7.1.280.0040.01115.66
7.1.270.0070.00715.80
7.1.260.0090.00315.91
7.1.250.0030.00715.80
7.1.240.0000.01515.63
7.1.230.0060.00615.68
7.1.220.0030.00615.98
7.1.210.0080.00415.86
7.1.200.0070.00715.73
7.1.190.0080.00415.80
7.1.180.0000.01015.91
7.1.170.0060.00915.76
7.1.160.0130.00216.02
7.1.150.0070.00715.65
7.1.140.0030.01215.96
7.1.130.0000.01615.99
7.1.120.0040.01215.91
7.1.110.0070.00415.66
7.1.100.0030.00915.95
7.1.90.0090.00615.63
7.1.80.0030.01015.88
7.1.70.0060.00816.58
7.1.60.0050.01417.87
7.1.50.0080.00816.46
7.1.40.0120.00315.79
7.1.30.0000.01415.75
7.1.20.0040.01115.88
7.1.10.0000.01215.94
7.1.00.0030.04118.96
7.0.330.0000.01215.52
7.0.320.0040.00715.46
7.0.310.0090.00615.57
7.0.300.0000.01515.50
7.0.290.0070.00715.44
7.0.280.0080.00315.35
7.0.270.0000.01315.54
7.0.260.0080.00015.54
7.0.250.0030.00915.32
7.0.240.0050.00515.42
7.0.230.0030.01015.49
7.0.220.0060.00915.34
7.0.210.0070.00715.29
7.0.200.0060.00716.13
7.0.190.0040.00715.46
7.0.180.0040.00815.39
7.0.170.0030.01415.38
7.0.160.0090.00615.38
7.0.150.0040.00815.23
7.0.140.0070.03718.66
7.0.130.0070.00715.44
7.0.120.0040.00415.41
7.0.110.0000.01015.57
7.0.100.0060.00615.25
7.0.90.0030.01015.50
7.0.80.0040.00715.34
7.0.70.0070.00715.38
7.0.60.0090.04217.73
7.0.50.0030.04416.52
7.0.40.0060.02516.89
7.0.30.0200.04416.67
7.0.20.0200.03716.86
7.0.10.0250.02316.86
7.0.00.0050.02716.84
5.6.400.0100.00314.49
5.6.390.0000.01214.68
5.6.380.0030.00514.49
5.6.370.0090.00614.41
5.6.360.0000.01514.51
5.6.350.0040.00814.30
5.6.340.0000.00914.05
5.6.330.0120.00014.15
5.6.320.0040.00414.05
5.6.310.0060.00714.64
5.6.300.0100.00014.29
5.6.290.0090.00314.21
5.6.280.0050.04017.71
5.6.270.0040.00714.51
5.6.260.0040.00814.14
5.6.250.0060.00614.28
5.6.240.0060.00614.16
5.6.230.0000.01414.50
5.6.220.0000.01314.63
5.6.210.0030.02417.48
5.6.200.0070.04216.37
5.6.190.0030.04417.51
5.6.180.1860.02217.50
5.6.170.0120.02717.48
5.6.160.0100.04517.46
5.6.150.0080.04016.25
5.6.140.0050.03616.29
5.6.130.0030.02316.26
5.6.120.0070.02717.66
5.6.110.0060.04417.54
5.6.100.0080.04517.81
5.6.90.0070.04317.65
5.6.80.0070.04717.35
5.6.70.2220.02417.31
5.6.60.0030.00914.28
5.6.50.0070.00314.30
5.6.40.0030.00714.44
5.6.30.0030.01314.36
5.6.20.0040.00414.25
5.6.10.0110.00314.18
5.6.00.0030.01314.39
5.5.380.0030.00614.45
5.5.370.0060.00314.62
5.5.360.0060.00914.38
5.5.350.0030.05017.58
5.5.340.0080.04516.10
5.5.330.0090.03717.11
5.5.320.0190.03917.32
5.5.310.0120.02317.57
5.5.300.0080.03816.16
5.5.290.0070.04716.10
5.5.280.0030.02417.48
5.5.270.0060.04517.50
5.5.260.0100.04017.46
5.5.250.0090.02717.47
5.5.240.0120.03817.32
5.5.230.0070.00714.23
5.5.220.0030.01014.39
5.5.210.0090.00314.18
5.5.200.0000.00914.27
5.5.190.0030.01214.33
5.5.180.0030.00914.43
5.5.170.0000.01213.98
5.5.160.0090.00614.29
5.5.150.0090.00014.45
5.5.140.0030.01314.16
5.5.130.0000.01214.27
5.5.120.0090.00314.44
5.5.110.0070.00714.50
5.5.100.0030.01014.36
5.5.90.0070.00714.30
5.5.80.0040.00414.41
5.5.70.0070.00714.20
5.5.60.0060.00914.35
5.5.50.0070.00714.31
5.5.40.0090.00614.31
5.5.30.0070.00413.86
5.5.20.0030.00713.91
5.5.10.0050.00514.31
5.5.00.0060.00614.04
5.4.450.0160.02215.35
5.4.440.0310.02615.30
5.4.430.0320.02515.38
5.4.420.0170.02515.32
5.4.410.0090.02915.13
5.4.400.0120.03314.91
5.4.390.0050.02814.92
5.4.380.0120.03015.02
5.4.370.0110.02714.76
5.4.360.0070.03014.80
5.4.350.0150.02814.94
5.4.340.0120.03014.78
5.4.330.0030.01011.18
5.4.320.0110.02011.91
5.4.310.0050.02611.71
5.4.300.0040.02511.82
5.4.290.0060.02411.79
5.4.280.0100.02211.93
5.4.270.0070.02511.77
5.4.260.0090.02111.82
5.4.250.0070.02611.88
5.4.240.0050.02311.84
5.4.230.0050.02211.56
5.4.220.0080.01911.68
5.4.210.0020.02611.60
5.4.200.0060.02111.81
5.4.190.0040.02211.76
5.4.180.0040.02411.64
5.4.170.0040.02111.83
5.4.160.0050.01911.60
5.4.150.0030.02411.53
5.4.140.0040.02611.56
5.4.130.0020.02411.62
5.4.120.0070.01911.70
5.4.110.0050.02511.37
5.4.100.0080.02311.49
5.4.90.0050.02411.60
5.4.80.0040.02611.70
5.4.70.0050.02011.56
5.4.60.0070.01911.54
5.4.50.0050.02011.56
5.4.40.0040.02011.61
5.4.30.0060.01911.45
5.4.20.0050.02111.63
5.4.10.0080.01911.40
5.4.00.0040.02111.30
5.3.290.0060.02111.67
5.3.280.0060.02211.69
5.3.270.0040.02411.70
5.3.260.0050.02311.72
5.3.250.0040.02311.70
5.3.240.0060.02111.61
5.3.230.0050.02411.61
5.3.220.0080.01911.59
5.3.210.0060.02011.62
5.3.200.0070.02611.62
5.3.190.0060.02011.71
5.3.180.0050.02011.71
5.3.170.0070.02011.76
5.3.160.0080.01911.63
5.3.150.0020.02311.72
5.3.140.0060.02111.73
5.3.130.0070.02811.63
5.3.120.0050.02311.63
5.3.110.0060.02211.65
5.3.100.0050.02211.28
5.3.90.0060.02211.39
5.3.80.0090.02511.30
5.3.70.0080.02111.30
5.3.60.0050.02311.31
5.3.50.0080.02211.36
5.3.40.0050.02211.31
5.3.30.0050.02211.19
5.3.20.0050.02611.11
5.3.10.0040.02511.02
5.3.00.0060.02211.02
5.2.170.0070.0359.18
5.2.160.0060.0359.18
5.2.150.0060.0299.18
5.2.140.0070.0279.18
5.2.130.0050.0289.14
5.2.120.0050.0299.14
5.2.110.0060.0289.14
5.2.100.0070.0269.15
5.2.90.0080.0319.14
5.2.80.0050.0359.14
5.2.70.0020.0409.13
5.2.60.0090.0319.09
5.2.50.0050.0359.07
5.2.40.0020.0329.04
5.2.30.0100.0329.02
5.2.20.0100.0369.00
5.2.10.0090.0308.91
5.2.00.0050.0358.77
5.1.60.0090.0308.04
5.1.50.0120.0348.05
5.1.40.0100.0308.03
5.1.30.0080.0308.38
5.1.20.0060.0368.41
5.1.10.0040.0378.13
5.1.00.0070.0288.12
5.0.50.0020.0226.61
5.0.40.0040.0276.46
5.0.30.0020.0346.28
5.0.20.0030.0266.26
5.0.10.0040.0196.23
5.0.00.0040.0306.23
4.4.90.0040.0154.78
4.4.80.0050.0134.75
4.4.70.0040.0194.75
4.4.60.0080.0164.76
4.4.50.0040.0154.77
4.4.40.0030.0254.71
4.4.30.0060.0134.76
4.4.20.0050.0144.84
4.4.10.0030.0164.85
4.4.00.0050.0234.76
4.3.110.0030.0164.67
4.3.100.0030.0154.66
4.3.90.0010.0184.64
4.3.80.0030.0254.57
4.3.70.0030.0204.63
4.3.60.0040.0154.63
4.3.50.0040.0154.63
4.3.40.0020.0304.53
4.3.30.0050.0243.30
4.3.20.0040.0143.28
4.3.10.0030.0153.23
4.3.00.0130.01015.05

preferences:
36.41 ms | 401 KiB | 5 Q