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]); } }

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.0110.01118.28
8.3.50.0100.00822.05
8.3.40.0000.01418.84
8.3.30.0090.00918.89
8.3.20.0040.00420.34
8.3.10.0060.00321.97
8.3.00.0000.00822.52
8.2.180.0190.00316.75
8.2.170.0110.00322.96
8.2.160.0000.01521.07
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00419.36
8.2.110.0130.00722.08
8.2.100.0000.01217.72
8.2.90.0040.00419.36
8.2.80.0040.00417.97
8.2.70.0070.00317.50
8.2.60.0050.00318.05
8.2.50.0000.00818.07
8.2.40.0080.00018.20
8.2.30.0040.00418.14
8.2.20.0040.00417.78
8.2.10.0040.00419.59
8.2.00.0000.00717.68
8.1.280.0100.00725.92
8.1.270.0000.00823.77
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.01023.82
8.1.230.0070.00418.95
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0070.00417.35
8.1.190.0050.00317.66
8.1.180.0030.00618.10
8.1.170.0060.00318.64
8.1.160.0040.00421.93
8.1.150.0050.00218.62
8.1.140.0040.00417.39
8.1.130.0000.00717.84
8.1.120.0040.00417.35
8.1.110.0000.00717.45
8.1.100.0000.00817.46
8.1.90.0000.00717.31
8.1.80.0040.00417.52
8.1.70.0030.00317.45
8.1.60.0000.01017.53
8.1.50.0040.00417.55
8.1.40.0000.00717.45
8.1.30.0040.00417.54
8.1.20.0050.00317.63
8.1.10.0000.00817.55
8.1.00.0040.00417.33
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0040.00418.39
8.0.270.0000.00717.16
8.0.260.0050.00218.43
8.0.250.0030.00416.85
8.0.240.0070.00016.97
8.0.230.0000.00716.93
8.0.220.0030.00316.77
8.0.210.0000.00716.78
8.0.200.0030.00316.94
8.0.190.0080.00016.86
8.0.180.0000.00816.96
8.0.170.0080.00016.93
8.0.160.0000.00716.89
8.0.150.0000.00816.80
8.0.140.0040.00416.86
8.0.130.0000.00613.32
8.0.120.0030.00516.75
8.0.110.0020.00516.83
8.0.100.0040.00416.77
8.0.90.0000.00716.76
8.0.80.0030.01216.83
8.0.70.0000.00816.86
8.0.60.0040.00416.80
8.0.50.0000.00816.75
8.0.30.0120.00917.12
8.0.20.0120.00717.40
8.0.10.0040.00417.04
8.0.00.0120.00516.68
7.4.330.0000.00615.02
7.4.320.0000.00616.56
7.4.300.0040.00416.51
7.4.290.0070.00016.56
7.4.280.0000.00716.61
7.4.270.0070.00016.50
7.4.260.0050.00216.58
7.4.250.0000.00716.55
7.4.240.0030.00316.58
7.4.230.0030.00316.62
7.4.220.0030.01416.53
7.4.210.0120.00316.68
7.4.200.0030.00416.60
7.4.190.0030.00516.62
7.4.160.0090.00616.50
7.4.150.0060.01517.40
7.4.140.0140.00817.86
7.4.130.0110.00916.50
7.4.120.0110.00916.49
7.4.110.0060.01016.67
7.4.100.0000.01616.67
7.4.90.0040.01516.45
7.4.80.0100.00719.39
7.4.70.0130.00316.60
7.4.60.0100.00616.52
7.4.50.0060.00316.56
7.4.40.0060.01222.77
7.4.30.0060.01216.44
7.4.00.0030.01315.07
7.3.330.0000.00513.01
7.3.320.0000.00612.97
7.3.310.0050.00216.34
7.3.300.0030.00416.30
7.3.290.0070.00716.25
7.3.280.0070.00916.22
7.3.270.0110.00717.40
7.3.260.0030.01416.51
7.3.250.0100.00816.50
7.3.240.0070.01416.41
7.3.230.0060.01216.48
7.3.210.0140.00616.21
7.3.200.0100.00719.39
7.3.190.0110.01116.27
7.3.180.0130.00316.23
7.3.170.0100.00716.47
7.3.160.0040.01116.45
7.3.120.0040.00814.59
7.2.330.0130.01016.68
7.2.320.0170.00416.68
7.2.310.0040.01216.77
7.2.300.0040.01316.73
7.2.290.0140.00316.46
7.2.00.0070.01119.35
7.1.200.0060.00915.66
7.1.100.0070.00718.23
7.1.70.0110.00517.26
7.1.60.0040.01119.82
7.1.50.0070.01817.07
7.1.00.0030.07322.45
7.0.200.0120.00016.63
7.0.140.0000.07021.99
7.0.60.0070.06019.91
7.0.50.0000.06017.91
7.0.40.0100.08720.20
7.0.30.0430.07320.04
7.0.20.0200.07020.33
7.0.10.0070.04020.00
7.0.00.0100.05720.12
5.6.280.0100.06720.87
5.6.210.0100.03720.70
5.6.200.0130.03318.18
5.6.190.0070.07320.21
5.6.180.3800.04020.32
5.6.170.0170.04720.45
5.6.160.0030.05320.53
5.6.150.0070.04718.12
5.6.140.0070.08318.21
5.6.130.0000.06318.07
5.6.120.0070.04320.97
5.6.110.0030.06721.01
5.6.100.0200.07720.88
5.6.90.0070.04320.86
5.6.80.0000.06320.48
5.6.70.4330.04320.32
5.5.350.0070.05720.43
5.5.340.0100.07717.93
5.5.330.0030.04720.56
5.5.320.4000.04020.24
5.5.310.0270.08320.35
5.5.300.0100.06017.91
5.5.290.0030.08017.98
5.5.280.0000.05720.80
5.5.270.0100.08020.75
5.5.260.0130.03320.73
5.5.250.0100.06020.61
5.5.240.0200.02720.26
5.4.450.2170.04319.13
5.4.440.1830.04719.38
5.4.430.2100.05319.37
5.4.420.1730.04719.45
5.4.410.1870.04019.13
5.4.400.1500.04318.94
5.4.390.1900.03019.16
5.4.380.1930.04719.24
5.4.370.0330.05719.13
5.4.360.0030.04018.81
5.4.350.0630.09319.08
5.4.340.1530.04318.97
5.4.320.2070.03718.77
5.4.310.1900.03319.12
5.4.300.1830.03318.80
5.4.290.2100.05018.95
5.4.280.1970.04319.24
5.4.270.1430.03019.24
5.4.260.2030.04318.91
5.4.250.1870.04318.87
5.4.240.1970.04718.91
5.4.230.0770.05019.04
5.4.220.0030.06719.23
5.4.210.0100.04718.80
5.4.200.1830.03719.25
5.4.190.1870.05019.23
5.4.180.2100.04718.90
5.4.170.1930.03719.09
5.4.160.2000.04019.04
5.4.150.1830.03319.05
5.4.140.1800.03316.46
5.4.130.2170.03316.29
5.4.120.1830.03316.27
5.4.110.2200.04316.20
5.4.100.0830.03316.42
5.4.90.0000.06716.48
5.4.80.0030.05316.51
5.4.70.0500.03716.44
5.4.60.2170.04716.41
5.4.50.2230.04016.43
5.4.40.2230.03716.31
5.4.30.1770.03316.39
5.4.20.2000.04316.36
5.4.10.2070.04016.27
5.4.00.1900.03015.71
5.3.290.1770.04014.68
5.3.280.1400.04014.60
5.3.270.1900.03014.67
5.3.260.0030.04014.62
5.3.250.0070.05714.44
5.3.240.0870.05714.63
5.3.230.1870.03014.59
5.3.220.1800.03314.52
5.3.210.1900.03714.62
5.3.200.1830.03314.42
5.3.190.1730.04014.52
5.3.180.2070.04314.40
5.3.170.1930.03314.41
5.3.160.0330.05714.42
5.3.150.0030.03714.44
5.3.140.0000.03714.41
5.3.130.0670.03314.39
5.3.120.1700.04314.50
5.3.110.1000.04714.39
5.3.100.0030.04714.05
5.3.90.0000.04714.07
5.3.80.0000.04013.86
5.3.70.1800.03313.80
5.3.60.1730.04014.10
5.3.50.1730.03713.80
5.3.40.1830.03013.80
5.3.30.1800.03313.75
5.3.20.2030.04313.49
5.3.10.1930.02713.46
5.3.00.1770.04013.59
5.2.170.1730.03011.33
5.2.160.1900.03011.17
5.2.150.1570.03011.11
5.2.140.2070.02011.20
5.2.130.1500.02710.95
5.2.120.1970.03711.16
5.2.110.1600.03010.96
5.2.100.1700.03310.95
5.2.90.1530.02310.99
5.2.80.1630.03311.04
5.2.70.1670.03710.94
5.2.60.1500.02711.13
5.2.50.1530.03010.88
5.2.40.1230.02710.89
5.2.30.1530.03310.86
5.2.20.1230.02711.04
5.2.10.1330.03011.02
5.2.00.1200.02710.61
5.1.60.1330.02010.05
5.1.50.1200.0279.90
5.1.40.1370.0339.96
5.1.30.1270.02310.39
5.1.20.1370.02010.46
5.1.10.1400.0309.98
5.1.00.1200.02310.09
5.0.50.0830.0308.53
5.0.40.0630.0238.30
5.0.30.0930.0408.15
5.0.20.0700.0278.28
5.0.10.0730.0238.10
5.0.00.0800.0478.30
4.4.90.0600.0137.95
4.4.80.0600.0177.95
4.4.70.0570.0177.95
4.4.60.0800.0107.95
4.4.50.0670.0177.95
4.4.40.0600.0277.95
4.4.30.0070.0207.95
4.4.20.0000.0177.95
4.4.10.0000.0307.95
4.4.00.0000.0237.95
4.3.110.0000.0177.95
4.3.100.0000.0177.95
4.3.90.0030.0137.95
4.3.80.0230.0507.95
4.3.70.0630.0137.95
4.3.60.0600.0177.95
4.3.50.0600.0177.95
4.3.40.0630.0277.95
4.3.30.0330.0177.95
4.3.20.0300.0207.95
4.3.10.0300.0137.95
4.3.00.0300.0137.95

preferences:
33.95 ms | 401 KiB | 5 Q