3v4l.org

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

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.0130.00717.80
8.4.120.0070.00220.68
8.4.110.0130.00718.76
8.4.100.0050.00417.67
8.4.90.0100.00620.58
8.4.80.0050.00418.82
8.4.70.0090.00918.80
8.4.60.0050.00620.84
8.4.50.0150.00818.40
8.4.40.0130.00619.28
8.4.30.0190.00018.93
8.4.20.0000.00918.73
8.4.10.0160.00017.75
8.3.260.0130.00616.77
8.3.250.0110.00718.74
8.3.240.0140.00616.85
8.3.230.0100.00716.52
8.3.220.0070.00119.03
8.3.210.0100.00816.75
8.3.200.0060.00316.72
8.3.190.0120.00217.12
8.3.180.0100.00719.01
8.3.170.0160.00317.08
8.3.160.0070.01117.14
8.3.150.0150.00418.50
8.3.140.0070.01116.79
8.3.130.0040.00416.67
8.3.120.0060.00318.91
8.3.110.0130.00620.94
8.3.100.0040.00424.06
8.3.90.0080.01226.77
8.3.80.0090.00019.36
8.3.70.0090.01218.55
8.3.60.0140.00718.43
8.3.50.0090.00921.15
8.3.40.0090.01218.84
8.3.30.0090.00618.68
8.3.20.0040.00420.95
8.3.10.0040.00420.21
8.3.00.0080.00023.69
8.2.290.0090.01016.95
8.2.280.0100.00918.20
8.2.270.0040.01518.63
8.2.260.0070.01116.94
8.2.250.0060.00316.62
8.2.240.0030.00518.85
8.2.230.0000.00822.58
8.2.220.0070.00337.54
8.2.210.0090.00326.77
8.2.200.0100.00018.88
8.2.190.0040.01118.16
8.2.180.0130.00716.63
8.2.170.0140.00722.96
8.2.160.0100.00322.12
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.95
8.2.110.0030.00622.08
8.2.100.0040.00817.91
8.2.90.0000.00817.63
8.2.80.0050.00318.82
8.2.70.0000.00918.05
8.2.60.0060.00317.50
8.2.50.0000.00817.55
8.2.40.0060.00319.27
8.2.30.0050.00219.27
8.2.20.0000.00718.13
8.2.10.0050.00219.18
8.2.00.0000.00719.22
8.1.330.0080.01015.91
8.1.320.0120.00716.20
8.1.310.0150.00016.58
8.1.300.0060.00315.94
8.1.290.0060.00330.84
8.1.280.0080.00625.92
8.1.270.0000.00722.02
8.1.260.0070.01326.35
8.1.250.0050.00328.09
8.1.240.0060.00323.95
8.1.230.0040.00718.99
8.1.220.0080.00017.74
8.1.210.0000.00918.77
8.1.200.0040.00417.48
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0040.00418.75
8.1.160.0040.00418.96
8.1.150.0000.00818.86
8.1.140.0050.00220.87
8.1.130.0000.00720.03
8.1.120.0000.00817.39
8.1.110.0000.00717.52
8.1.100.0040.00417.47
8.1.90.0060.00317.52
8.1.80.0040.00417.48
8.1.70.0030.00517.48
8.1.60.0000.00717.57
8.1.50.0030.00517.53
8.1.40.0040.00417.48
8.1.30.0090.00317.50
8.1.20.0040.00417.63
8.1.10.0050.00317.52
8.1.00.0050.00317.43
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0040.00418.36
8.0.270.0030.00316.73
8.0.260.0000.00620.00
8.0.250.0030.00316.97
8.0.240.0030.00316.96
8.0.230.0040.00416.95
8.0.220.0060.00316.77
8.0.210.0030.00316.89
8.0.200.0050.00316.99
8.0.190.0030.00316.91
8.0.180.0040.00416.86
8.0.170.0040.00416.92
8.0.160.0050.00316.86
8.0.150.0000.00716.84
8.0.140.0070.00016.85
8.0.130.0030.00313.25
8.0.120.0000.00716.82
8.0.110.0000.00716.93
8.0.100.0070.00016.93
8.0.90.0080.00016.77
8.0.80.0100.00416.89
8.0.70.0060.00316.84
8.0.60.0080.00016.97
8.0.50.0040.00416.86
8.0.30.0040.01217.41
8.0.20.0160.00617.15
8.0.10.0040.00417.05
8.0.00.0130.00816.76
7.4.330.0020.00215.55
7.4.320.0000.00616.37
7.4.300.0030.00316.57
7.4.290.0000.00716.45
7.4.280.0060.00316.57
7.4.270.0030.00316.48
7.4.260.0030.00313.27
7.4.250.0000.00716.40
7.4.240.0030.00416.49
7.4.230.0060.00316.54
7.4.220.0020.00516.56
7.4.210.0050.01016.49
7.4.200.0000.00816.35
7.4.140.0140.00417.86
7.4.130.0100.00716.39
7.4.120.0070.01016.44
7.4.110.0110.00616.70
7.4.100.0030.01416.48
7.4.90.0120.00616.53
7.4.80.0130.00419.39
7.4.70.0070.01016.60
7.4.60.0030.01316.52
7.4.50.0120.00616.54
7.4.40.0140.00816.57
7.4.10.0030.01415.09
7.4.00.0050.01214.91
7.3.330.0050.00216.39
7.3.320.0050.00013.18
7.3.310.0030.00316.34
7.3.300.0030.00316.26
7.3.290.0070.00716.36
7.3.280.0060.01016.39
7.3.260.0110.00716.41
7.3.240.0090.00916.41
7.3.230.0130.00316.41
7.3.210.0100.00716.63
7.3.200.0100.00716.44
7.3.190.0060.00916.43
7.3.180.0080.00816.41
7.3.170.0120.00616.32
7.3.160.0070.01016.50
7.3.130.0110.00715.05
7.3.120.0030.01414.82
7.3.110.0100.00614.83
7.3.100.0110.00614.71
7.3.90.0040.00814.85
7.3.80.0120.00514.93
7.3.70.0080.00814.74
7.3.60.0060.01114.72
7.3.50.0050.01014.63
7.3.40.0050.01214.66
7.3.30.0100.00514.70
7.3.20.0220.00716.05
7.3.10.0160.00716.00
7.3.00.0140.00815.97
7.2.330.0070.01116.84
7.2.320.0080.00816.69
7.2.310.0090.01016.79
7.2.300.0090.00916.64
7.2.290.0000.01616.55
7.2.260.0000.01215.31
7.2.250.0050.01215.11
7.2.240.0060.01114.98
7.2.230.0090.00514.97
7.2.220.0070.00814.54
7.2.210.0080.00915.06
7.2.200.0070.01014.99
7.2.190.0050.01015.04
7.2.180.0060.01114.90
7.2.170.0080.00814.99
7.2.160.0080.00814.76
7.2.150.0140.00716.28
7.2.140.0170.00516.29
7.2.130.0200.00516.23
7.2.120.0100.01116.09
7.2.110.0130.00716.20
7.2.100.0130.01016.10
7.2.90.0150.01216.08
7.2.80.0280.00916.27
7.2.70.0180.00716.18
7.2.60.0130.01016.24
7.2.50.0200.00716.31
7.2.40.0160.01116.12
7.2.30.0200.00716.27
7.2.20.0190.00916.22
7.2.10.0190.00316.19
7.2.00.0120.01016.14
7.1.330.0070.00715.70
7.1.320.0040.00815.60
7.1.310.0190.00515.15
7.1.300.0180.00715.02
7.1.290.0160.00815.14
7.1.280.0170.00615.00
7.1.270.0180.00315.24
7.1.260.0150.01015.09
7.1.250.0180.00715.03
7.1.240.0030.01415.68
7.1.230.0060.00315.73
7.1.220.0030.01215.79
7.1.210.0080.00615.83
7.1.200.0110.00315.57
7.1.190.0000.00815.91
7.1.180.0090.00015.67
7.1.170.0100.00715.61
7.1.160.0070.00715.75
7.1.150.0060.00315.84
7.1.140.0030.00615.88
7.1.130.0070.00415.78
7.1.120.0040.01115.48
7.1.110.0030.01215.81
7.1.100.0080.00815.95
7.1.90.0040.01115.83
7.1.80.0110.00315.83
7.1.70.0000.00915.82
7.1.60.0000.01415.77
7.1.50.0030.00715.87
7.1.40.0000.01015.78
7.1.30.0070.00715.81
7.1.20.0030.00715.88
7.1.10.0030.01015.91
7.1.00.0030.01015.91

preferences:
30.89 ms | 403 KiB | 5 Q