3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 1 => "tenants", 2 => "modules", ]; $array2 = [ "prefix" => "tenants", "slug" => "tenants", "child" => [ [ "prefix" => "modules/{id}", "slug" => "modules" ], [ "prefix" => "fetch/{id}", "slug" => "fetch" ], ], ]; function getFromChild($item, $asd) { if (!is_array($item)) return []; $res = []; if ($item["slug"] == $asd) $res[] = $item['prefix']; if (isset($item['child'])) foreach($item['child'] as $child) $res = array_merge($res, getFromChild($child, $asd)); return $res; } $res = []; foreach ($array1 as $asd) { $res = array_merge($res, getFromChild($array2, $asd)); } print_r($res);

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.00918.73
8.4.120.0100.00924.01
8.4.110.0060.00322.38
8.4.100.0130.00717.70
8.4.90.0140.00818.65
8.4.80.0140.00518.00
8.4.70.0170.00717.82
8.4.60.0120.00918.42
8.4.50.0070.00717.75
8.4.40.0100.01019.48
8.4.30.0130.00318.56
8.4.20.0040.00418.82
8.4.10.0100.01017.43
8.3.260.0110.00516.59
8.3.250.0050.00418.79
8.3.240.0110.00817.17
8.3.230.0120.00716.70
8.3.220.0090.00917.21
8.3.210.0110.00716.62
8.3.200.0050.00616.59
8.3.190.0090.01017.39
8.3.180.0080.01116.64
8.3.170.0000.01818.85
8.3.160.0100.01018.50
8.3.150.0070.01120.51
8.3.140.0040.01516.60
8.3.130.0030.00816.61
8.3.120.0000.00820.65
8.3.110.0040.00416.61
8.3.100.0150.00018.29
8.3.90.0080.00016.77
8.3.80.0060.00317.97
8.3.70.0120.00318.31
8.3.60.0120.00318.68
8.3.50.0250.00321.99
8.3.40.0140.00718.93
8.3.30.0120.00318.57
8.3.20.0070.00722.61
8.3.10.0070.00020.18
8.3.00.0040.00423.66
8.2.290.0110.00720.33
8.2.280.0140.00520.07
8.2.270.0140.00417.33
8.2.260.0040.01118.83
8.2.250.0130.00616.85
8.2.240.0030.00618.21
8.2.230.0090.00620.94
8.2.220.0040.00424.06
8.2.210.0060.00626.77
8.2.200.0060.00316.88
8.2.190.0120.00616.88
8.2.180.0070.01016.50
8.2.170.0040.01122.96
8.2.160.0130.00022.13
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0040.00421.07
8.2.110.0030.00721.00
8.2.100.0110.00017.84
8.2.90.0040.00418.03
8.2.80.0050.00317.97
8.2.70.0070.00418.05
8.2.60.0060.00318.21
8.2.50.0050.00318.10
8.2.40.0040.00419.47
8.2.30.0040.00419.37
8.2.20.0070.00018.12
8.2.10.0000.00719.20
8.2.00.0070.00019.19
8.1.330.0070.01121.84
8.1.320.0080.01016.11
8.1.310.0070.01017.00
8.1.300.0040.00416.04
8.1.290.0030.00618.88
8.1.280.0210.00025.92
8.1.270.0000.00722.19
8.1.260.0110.01126.35
8.1.250.0030.00528.09
8.1.240.0040.00422.06
8.1.230.0120.00022.75
8.1.220.0000.00817.77
8.1.210.0080.00018.92
8.1.200.0000.01017.34
8.1.190.0060.00317.10
8.1.180.0000.00818.10
8.1.170.0030.00518.50
8.1.160.0000.00718.77
8.1.150.0030.00618.77
8.1.140.0000.00720.81
8.1.130.0000.00820.16
8.1.120.0050.00217.44
8.1.110.0040.00417.41
8.1.100.0000.00817.46
8.1.90.0030.00617.47
8.1.80.0030.00517.37
8.1.70.0000.00717.36
8.1.60.0060.00317.62
8.1.50.0000.00717.53
8.1.40.0030.00517.55
8.1.30.0000.00817.67
8.1.20.0040.00417.55
8.1.10.0020.00517.45
8.1.00.0000.00717.49
8.0.300.0000.00821.90
8.0.290.0090.00016.63
8.0.280.0030.00318.52
8.0.270.0070.00017.26
8.0.260.0080.00020.13
8.0.250.0040.00416.84
8.0.240.0030.00316.93
8.0.230.0050.00316.85
8.0.220.0050.00316.90
8.0.210.0000.00716.94
8.0.200.0060.00017.00
8.0.190.0050.00316.85
8.0.180.0040.00416.78
8.0.170.0040.00416.89
8.0.160.0000.00716.94
8.0.150.0000.00716.75
8.0.140.0070.00016.84
8.0.130.0000.00613.30
8.0.120.0000.00816.83
8.0.110.0000.00816.93
8.0.100.0040.00416.85
8.0.90.0030.00616.92
8.0.80.0080.01216.89
8.0.70.0030.00516.75
8.0.60.0070.00016.77
8.0.50.0000.00716.80
8.0.30.0110.00917.19
8.0.20.0070.01017.01
8.0.10.0000.00716.89
8.0.00.0080.01016.62
7.4.330.0030.00315.55
7.4.320.0000.00616.61
7.4.300.0000.00616.43
7.4.290.0000.00716.56
7.4.280.0040.00416.49
7.4.270.0040.00416.60
7.4.260.0050.00013.29
7.4.250.0030.00316.40
7.4.240.0050.00216.52
7.4.230.0070.00016.63
7.4.220.0020.00516.53
7.4.210.0110.00616.63
7.4.200.0040.00416.43
7.4.140.0030.01517.86
7.4.130.0180.00616.64
7.4.120.0080.00816.57
7.4.110.0150.00716.52
7.4.100.0090.01016.63
7.4.90.0100.00616.52
7.4.80.0110.00619.39
7.4.70.0130.00316.55
7.4.60.0120.00416.40
7.4.50.0080.00316.51
7.4.40.0140.00316.57
7.4.10.0080.00814.40
7.4.00.0090.00715.06
7.3.330.0030.00316.18
7.3.320.0000.00613.29
7.3.310.0040.00416.18
7.3.300.0000.00716.37
7.3.290.0000.00716.12
7.3.280.0060.00916.30
7.3.260.0110.00816.50
7.3.240.0090.00816.44
7.3.230.0070.01016.40
7.3.210.0090.00616.40
7.3.200.0100.00716.36
7.3.190.0130.00316.29
7.3.180.0130.00616.41
7.3.170.0060.00916.56
7.3.160.0060.01316.58
7.3.130.0100.01014.55
7.3.120.0110.00614.78
7.3.110.0080.01114.81
7.3.100.0040.01114.80
7.3.90.0000.01214.65
7.3.80.0080.00414.83
7.3.70.0060.00614.81
7.3.60.0100.00514.75
7.3.50.0090.00514.74
7.3.40.0080.00314.64
7.3.30.0070.00514.57
7.3.20.0050.00816.52
7.3.10.0060.00816.53
7.3.00.0080.00216.56
7.2.330.0070.01116.76
7.2.320.0070.01616.86
7.2.310.0060.01116.70
7.2.300.0070.01016.52
7.2.290.0110.00716.88
7.2.260.0130.00314.29
7.2.250.0050.01315.08
7.2.240.0100.00714.88
7.2.230.0050.00914.96
7.2.220.0030.00915.20
7.2.210.0060.00815.02
7.2.200.0050.00515.15
7.2.190.0060.01015.13
7.2.180.0050.00914.90
7.2.170.0070.00914.97
7.2.160.0080.00414.97
7.2.150.0050.01016.52
7.2.140.0050.00816.90
7.2.130.0090.00317.01
7.2.120.0090.00417.07
7.2.110.0080.00516.84
7.2.100.0050.00916.87
7.2.90.0020.00917.02
7.2.80.0030.00816.88
7.2.70.0070.00916.80
7.2.60.0070.00617.04
7.2.50.0050.00816.74
7.2.40.0060.00916.95
7.2.30.0090.00616.74
7.2.20.0100.00916.91
7.2.10.0070.00716.70
7.2.00.0080.00616.83
7.1.330.0040.01015.87
7.1.320.0060.00715.93
7.1.310.0100.00315.85
7.1.300.0010.01115.86
7.1.290.0050.00915.72
7.1.280.0060.00815.80
7.1.270.0060.00815.80
7.1.260.0060.00815.72
7.1.250.0060.00815.85
7.1.240.0070.00315.22
7.1.230.0060.00915.52
7.1.220.0060.00315.61
7.1.210.0030.01415.95
7.1.200.0070.00315.58
7.1.190.0090.00615.77
7.1.180.0140.00315.71
7.1.170.0130.00015.59
7.1.160.0030.01315.32
7.1.150.0150.00015.84
7.1.140.0000.01715.67
7.1.130.0000.01715.23
7.1.120.0030.00915.16
7.1.110.0130.00315.72
7.1.100.0070.00715.46
7.1.90.0070.01015.93
7.1.80.0030.01215.82
7.1.70.0060.00915.68
7.1.60.0040.01115.82
7.1.50.0030.01515.48
7.1.40.0080.00315.68
7.1.30.0060.01215.52
7.1.20.0000.01415.64
7.1.10.0030.01315.44
7.1.00.0030.01015.66

preferences:
119.73 ms | 403 KiB | 5 Q