3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'Id' => 1, 'Title' => 'Some Text1', 'Children' => [ [ 'Id' => 22, 'Title' => 'Some Text22', 'Children' => [ [ 'Id' => 333, 'Title' => 'Some Text333' ], [ 'Id' => 334, 'Title' => 'Some Text334', 'Children' => [ [ 'Id' => 4444, 'Title' => 'Some Text4443' ] ] ] ] ], [ 'Id' => 23, 'Title' => 'Some Text23', 'Children' => [ [ 'Id' => 335, 'Title' => 'Some Text335' ] ] ] ] ], [ 'Id' => 2, 'Title' => 'Some Text2', ] ]; function pathFinder(array $array, string $find, string $path = ''): array { $paths = []; foreach ($array as $item) { $currentPath = $path . ($path ? ' -> ' : '') . $item['Id']; if (str_contains($item['Title'], $find)) { $paths[] = $currentPath; } if (isset($item['Children'])) { array_push( $paths, ...pathFinder($item['Children'], $find, $currentPath) ); } } return $paths; } var_export( pathFinder($array, 'Some Text335') );

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.5.10.0090.00916.61
8.5.00.0090.01320.02
8.4.150.0020.00014.05
8.4.140.0100.01117.84
8.4.130.0090.01018.03
8.4.120.0100.01020.55
8.4.110.0100.01122.61
8.4.100.0090.01117.86
8.4.90.0120.00517.77
8.4.80.0070.00117.77
8.4.70.0130.01119.44
8.4.60.0120.00919.05
8.4.50.0070.01318.58
8.4.40.0100.01018.79
8.4.30.0140.00718.73
8.4.20.0140.00219.43
8.4.10.0030.00619.63
8.3.280.0090.01218.31
8.3.270.0120.00816.80
8.3.260.0090.00816.67
8.3.250.0140.00419.22
8.3.240.0100.00916.63
8.3.230.0100.00916.59
8.3.220.0140.00516.82
8.3.210.0100.00816.82
8.3.200.0060.00316.72
8.3.190.0130.00618.20
8.3.180.0100.00916.64
8.3.170.0090.00917.14
8.3.160.0070.01420.68
8.3.150.0110.00717.35
8.3.140.0120.00420.73
8.3.130.0140.01118.21
8.3.120.0170.00918.10
8.3.110.0130.01118.33
8.3.100.0230.00016.48
8.3.90.0180.00418.05
8.3.80.0230.00016.62
8.3.70.0170.00518.09
8.3.60.0160.00516.38
8.3.50.0220.00016.73
8.3.40.0120.00617.14
8.3.30.0160.00017.53
8.3.20.0110.00617.47
8.3.10.0160.00017.54
8.3.00.0000.01119.14
8.2.290.0080.01020.43
8.2.280.0120.00718.68
8.2.270.0160.00316.88
8.2.260.0060.01116.53
8.2.250.0130.00416.35
8.2.240.0150.00316.64
8.2.230.0110.00716.40
8.2.220.0120.00815.96
8.2.210.0140.00516.63
8.2.200.0120.00616.50
8.2.190.0120.00616.50
8.2.180.0130.00416.46
8.2.170.0180.00417.36
8.2.160.0140.00517.40
8.2.150.0120.00617.42
8.2.140.0180.00317.17
8.2.130.0160.00317.37
8.2.120.0180.00017.61
8.2.110.0170.00017.29
8.2.100.0120.00617.38
8.2.90.0140.00317.48
8.2.80.0130.00518.98
8.2.70.0170.00017.52
8.2.60.0190.00017.17
8.2.50.0170.00017.37
8.2.40.0110.00717.45
8.2.30.0120.00417.38
8.2.20.0130.00317.64
8.2.10.0150.00017.37
8.2.00.0130.00417.37
8.1.330.0110.00622.07
8.1.320.0120.00818.08
8.1.310.0140.00317.76
8.1.300.0120.00616.18
8.1.290.0080.00817.66
8.1.280.0170.00016.29
8.1.270.0150.00318.95
8.1.260.0110.00517.58
8.1.250.0130.00617.14
8.1.240.0080.00817.20
8.1.230.0130.00417.05
8.1.220.0050.01017.46
8.1.210.0190.00017.25
8.1.200.0150.00217.14
8.1.190.0120.00617.25
8.1.180.0090.00917.05
8.1.170.0170.00317.29
8.1.160.0110.00718.73
8.1.150.0110.00618.84
8.1.140.0100.01016.95
8.1.130.0110.00819.01
8.1.120.0140.00317.36
8.1.110.0160.00016.96
8.1.100.0140.00317.25
8.1.90.0160.00418.76
8.1.80.0200.00017.03
8.1.70.0100.00817.41
8.1.60.0150.00319.29
8.1.50.0140.00417.37
8.1.40.0150.00517.24
8.1.30.0060.01219.29
8.1.20.0190.00017.15
8.1.10.0180.00017.36
8.1.00.0080.01217.11

preferences:
59.93 ms | 403 KiB | 5 Q