3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menuArray = [ 'Main Street' => [], 'Activities' => [], 'Services' => [], 'Account' => [] ]; $lookup = [ 0 => 'Main Street', 1 => 'Activities', 2 => 'Services', 3 => 'Account', 4 => 'Communication' ]; $customsort = '4,2,1,3,0'; $keys = array_flip(explode(',', $customsort)); var_export($keys); $ordered_keys = array_flip(array_replace($keys, $lookup)); var_export($ordered_keys); $filtered_keys = array_intersect_key($ordered_keys, $menuArray); var_export($filtered_keys); $final = array_replace($filtered_keys, $menuArray); var_export($final);

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.4.130.0120.00517.66
8.4.120.0100.00920.43
8.4.110.0160.00722.32
8.4.100.0090.01118.18
8.4.90.0070.00418.99
8.4.80.0130.00518.75
8.4.70.0070.00718.02
8.4.60.0110.00918.93
8.4.50.0090.00917.38
8.4.40.0070.01019.23
8.4.30.0140.00317.60
8.4.20.0090.01220.44
8.4.10.0130.00617.75
8.3.250.0130.00218.91
8.3.240.0120.00720.82
8.3.230.0100.01016.48
8.3.220.0120.00618.79
8.3.210.0080.01016.38
8.3.200.0060.00316.57
8.3.190.0100.00816.61
8.3.180.0090.00618.38
8.3.170.0070.01119.01
8.3.160.0060.01216.48
8.3.150.0070.01118.98
8.3.140.0030.00616.63
8.3.130.0000.00818.30
8.3.120.0090.00020.55
8.3.110.0060.00320.94
8.3.100.0060.00316.38
8.3.90.0050.00318.18
8.3.80.0030.00618.45
8.3.70.0070.01116.12
8.3.60.0130.00616.25
8.3.50.0100.00718.17
8.3.40.0070.01118.79
8.3.30.0070.00718.48
8.3.20.0000.00819.04
8.3.10.0000.00723.61
8.3.00.0040.00420.32
8.2.290.0100.00920.36
8.2.280.0090.00816.86
8.2.270.0150.00317.01
8.2.260.0050.00319.03
8.2.250.0080.00018.16
8.2.240.0060.00317.07
8.2.230.0070.00322.58
8.2.220.0000.00837.54
8.2.210.0050.00326.77
8.2.200.0040.00416.38
8.2.190.0130.00716.58
8.2.180.0170.00316.88
8.2.170.0070.00722.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00318.03
8.2.120.0050.00326.35
8.2.110.0030.00620.86
8.2.100.0080.00417.84
8.2.90.0000.00817.91
8.2.80.0030.00617.97
8.2.70.0050.00317.91
8.2.60.0060.00318.09
8.2.50.0000.00818.10
8.2.40.0030.00618.99
8.2.30.0050.00319.19
8.2.20.0050.00317.98
8.2.10.0030.00618.07
8.2.00.0040.00417.76
8.1.330.0120.00722.05
8.1.320.0110.00816.11
8.1.310.0060.00316.71
8.1.300.0060.00318.35
8.1.290.0000.00918.88
8.1.280.0100.01025.92
8.1.270.0090.00022.14
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0100.00021.96
8.1.230.0070.00420.97
8.1.220.0030.00617.75
8.1.210.0080.00018.84
8.1.200.0050.01017.00
8.1.190.0050.00317.53
8.1.180.0060.00318.10
8.1.170.0040.00418.71
8.1.160.0000.00718.73
8.1.150.0000.00818.89
8.1.140.0030.00322.14
8.1.130.0070.00020.13
8.1.120.0030.00417.40
8.1.110.0040.00417.30
8.1.100.0040.00417.41
8.1.90.0000.00717.41
8.1.80.0030.00517.41
8.1.70.0050.00317.35
8.1.60.0040.00417.53
8.1.50.0050.00317.44
8.1.40.0040.00417.44
8.1.30.0000.00817.50
8.1.20.0000.00717.54
8.1.10.0040.00417.53
8.1.00.0040.00417.29
8.0.300.0030.00619.65
8.0.290.0040.00416.63
8.0.280.0040.00418.41
8.0.270.0000.00816.64
8.0.260.0000.00618.30
8.0.250.0030.00316.81
8.0.240.0050.00316.90
8.0.230.0040.00416.89
8.0.220.0030.00316.83
8.0.210.0000.00716.75
8.0.200.0040.00416.97
8.0.190.0050.00316.79
8.0.180.0070.00016.83
8.0.170.0000.00816.88
8.0.160.0000.00716.88
8.0.150.0000.00716.68
8.0.140.0050.00216.68
8.0.130.0030.00313.23
8.0.120.0040.00416.78
8.0.110.0000.00716.73
8.0.100.0040.00416.91
8.0.90.0040.00416.86
8.0.80.0040.01216.78
8.0.70.0040.00416.67
8.0.60.0040.00416.91
8.0.50.0030.00316.73
8.0.30.0140.00717.14
8.0.20.0090.01017.40
8.0.10.0040.00417.08
8.0.00.0120.00616.74
7.4.330.0000.00515.55
7.4.320.0040.00416.61
7.4.300.0000.00616.61
7.4.290.0060.00016.39
7.4.280.0040.00416.55
7.4.270.0070.00016.53
7.4.260.0040.00416.43
7.4.250.0030.00516.42
7.4.240.0000.00716.47
7.4.230.0030.00316.57
7.4.220.0050.00216.63
7.4.210.0090.01016.59
7.4.200.0040.00416.60
7.4.160.0100.00716.49
7.4.140.0110.01117.86
7.4.130.0100.00716.33
7.4.120.0070.01216.45
7.4.110.0060.01216.44
7.4.100.0060.01116.40
7.4.90.0030.02016.47
7.4.80.0130.00719.39
7.4.70.0060.01216.36
7.4.60.0100.01016.48
7.4.50.0130.00316.53
7.4.40.0030.01316.22
7.4.10.0170.00315.06
7.4.00.0030.00915.03
7.3.330.0000.00613.08
7.3.320.0030.00313.04
7.3.310.0060.00316.07
7.3.300.0070.00016.14
7.3.290.0030.00316.06
7.3.280.0120.00316.13
7.3.260.0110.00816.27
7.3.240.0070.01216.21
7.3.230.0100.00716.17
7.3.210.0160.00616.39
7.3.200.0090.00916.13
7.3.190.0130.01016.37
7.3.180.0110.00916.19
7.3.170.0080.00916.20
7.3.160.0030.01216.20
7.3.130.0040.01114.34
7.3.120.0130.00614.66
7.3.110.0100.01014.89
7.3.100.0070.00714.65
7.3.90.0040.01114.55
7.3.80.0130.00614.67
7.3.70.0030.00614.77
7.3.60.0060.00614.71
7.3.50.0060.00614.66
7.3.40.0130.00014.64
7.3.30.0030.01314.58
7.3.20.0030.01416.39
7.3.10.0000.01016.71
7.3.00.0110.00316.70
7.2.330.0180.00016.62
7.2.320.0100.00716.59
7.2.310.0160.00616.15
7.2.300.0030.01316.61
7.2.290.0000.01616.52
7.2.260.0090.01015.01
7.2.250.0010.01614.79
7.2.240.0030.01314.80
7.2.230.0110.00315.07
7.2.220.0070.00714.76
7.2.210.0030.00715.04
7.2.200.0000.01614.97
7.2.190.0040.00714.71
7.2.180.0090.00614.74
7.2.170.0000.01015.00
7.2.160.0060.01315.05
7.2.150.0070.00716.95
7.2.140.0030.00716.50
7.2.130.0100.00316.74
7.2.120.0060.00616.83
7.2.110.0100.00316.49
7.2.100.0110.00316.62
7.2.90.0050.01016.59
7.2.80.0080.00616.77
7.2.70.0080.00516.84
7.2.60.0030.00716.81
7.2.50.0090.00316.71
7.2.40.0110.00316.86
7.2.30.0090.00716.77
7.2.20.0060.00616.70
7.2.10.0070.00716.70
7.2.00.0100.00116.73
7.1.330.0110.00415.63
7.1.320.0120.00615.96
7.1.310.0040.00415.65
7.1.300.0040.00815.49
7.1.290.0000.00915.91
7.1.280.0030.00715.73
7.1.270.0000.01415.91
7.1.260.0030.00915.63
7.1.250.0100.00315.81
7.1.240.0030.00915.69
7.1.230.0050.01115.81
7.1.220.0060.00515.57
7.1.210.0050.01015.46
7.1.200.0040.00915.52
7.1.190.0060.00915.66
7.1.180.0040.00715.57
7.1.170.0030.01015.63
7.1.160.0040.01215.76
7.1.150.0060.00615.61
7.1.140.0060.00415.75
7.1.130.0050.00915.80
7.1.120.0070.00815.83
7.1.110.0030.01015.73
7.1.100.0020.01115.64
7.1.90.0050.00615.59
7.1.80.0060.00415.64
7.1.70.0070.00715.59
7.1.60.0110.01124.61
7.1.50.0150.00824.64
7.1.40.0110.01124.56
7.1.30.0090.01324.64
7.1.20.0170.01124.55
7.1.10.0100.00115.64
7.1.00.0070.00615.63
7.0.330.0030.00615.40
7.0.320.0090.00015.43
7.0.310.0080.00615.54
7.0.300.0060.01015.05
7.0.290.0070.00415.13
7.0.280.0090.00615.52
7.0.270.0040.00415.57
7.0.260.0070.00715.30
7.0.250.0070.00715.28
7.0.240.0000.01215.25
7.0.230.0060.00615.36
7.0.220.0090.00615.19
7.0.210.0040.00715.45
7.0.200.0060.00615.33
7.0.190.0000.00815.46
7.0.180.0040.00415.46
7.0.170.0070.00715.26
7.0.160.0060.00315.43
7.0.150.0000.01115.51
7.0.140.0110.00015.32
7.0.130.0000.01215.48
7.0.120.0040.00715.52
7.0.110.0090.00615.19
7.0.100.0030.01215.41
7.0.90.0040.00815.37
7.0.80.0060.00615.05
7.0.70.0040.01115.41
7.0.60.0000.01215.38
7.0.50.0080.00015.66
7.0.40.0040.00413.45
7.0.30.0070.00713.73
7.0.20.0000.01513.44
7.0.10.0030.01013.12
7.0.00.0030.01013.11
5.6.400.0070.00314.12
5.6.390.0040.01113.89
5.6.380.0050.00714.19
5.6.370.0000.01513.73
5.6.360.0000.01113.89
5.6.350.0000.01314.35
5.6.340.0090.00314.51
5.6.330.0040.00714.18
5.6.320.0100.00714.45
5.6.310.0000.01314.54
5.6.300.0030.01014.36
5.6.290.0030.00914.10
5.6.280.0000.01514.19
5.6.270.0060.00614.13
5.6.260.0070.00714.04
5.6.250.0030.01013.98
5.6.240.0070.00414.38
5.6.230.0060.00614.21
5.6.220.0110.00414.00
5.6.210.0000.01314.28
5.6.200.0060.00614.28
5.6.190.0030.01014.31
5.6.180.0080.00414.00
5.6.170.0040.01114.13
5.6.160.0080.00814.18
5.6.150.0110.00414.17
5.6.140.0070.00314.32
5.6.130.0030.00914.40
5.6.120.0070.00714.23
5.6.110.0110.00314.06
5.6.100.0030.01014.41
5.6.90.0090.00613.95
5.6.80.0040.00714.09
5.6.70.0070.00313.97
5.6.60.0080.00614.31
5.6.50.0080.00814.12
5.6.40.0090.00314.09
5.6.30.0070.00314.11
5.6.20.0060.00313.93
5.6.10.0000.00814.00
5.6.00.0060.01013.97

preferences:
98.33 ms | 403 KiB | 5 Q