3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'Dick Jansen', 'matchedMovie' => [ [ 'nameMovie' => 'Saw', 'genre' => 'Horror', 'patheMovie' => 'Texas Chainsaw 3D', 'patheMovieGenre' => 'Horror', 'score' => '100.00', ] ] ], [ 'name' => 'Jim Scott', 'matchedMovie' => [ [ 'nameMovie' => 'Shooter', 'genre' => 'Action, Thriller', 'patheMovie' => 'The Shining', 'patheMovieGenre' => 'Horror, Suspense/Thriller', 'score' => '52.38', ], [ 'nameMovie' => 'Resident Evil Movie', 'genre' => 'Action/Horror', 'patheMovie' => 'Texas Chainsaw 3D', 'patheMovieGenre' => 'Horror', 'score' => '63.16', ] ] ] ]; function findMovieMatches(array $movies, string $movieName): array { $result = []; foreach ($movies as ['name' => $name, 'matchedMovie' => $matches]) { foreach ($matches as $entry) { if ($movieName === $entry['patheMovie']) { $result[] = ['name' => $name] + $entry; } } } return $result; } var_export(findMovieMatches($array, 'Texas Chainsaw 3D')); echo "\n---\n"; var_export(findMovieMatches($array, 'The Shining'));

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.70.0130.00918.31
8.3.60.0160.00618.68
8.3.50.0090.00616.79
8.3.40.0080.00822.05
8.3.30.0120.00319.17
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0070.00026.16
8.2.190.0030.01316.75
8.2.180.0150.00318.41
8.2.170.0070.00719.04
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0070.00019.45
8.2.110.0100.00022.20
8.2.100.0350.00018.44
8.2.90.0260.00318.44
8.2.80.0290.00018.44
8.2.70.0240.00718.44
8.2.60.0230.00518.44
8.2.50.0280.00318.44
8.2.40.0220.00918.44
8.2.30.0300.00418.44
8.2.20.0350.00018.44
8.2.10.0210.00818.44
8.2.00.0220.00418.44
8.1.280.0140.00725.92
8.1.270.0060.00322.20
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.00920.90
8.1.230.0230.00818.44
8.1.220.0270.00318.44
8.1.210.0280.00518.44
8.1.200.0220.00418.44
8.1.190.0230.00318.44
8.1.180.0220.00418.44
8.1.170.0230.00318.44
8.1.160.0160.01018.44
8.1.150.0230.00418.44
8.1.140.0240.00218.44
8.1.130.0210.00618.44
8.1.120.0150.01118.44
8.1.110.0230.00418.44
8.1.100.0190.00818.44
8.1.90.0190.00618.44
8.1.80.0210.00718.44
8.1.70.0190.00618.44
8.1.60.0300.00018.44
8.1.50.0240.00618.44
8.1.40.0260.00418.44
8.1.30.0290.00018.44
8.1.20.0320.00018.44
8.1.10.0220.00718.44
8.1.00.0200.00318.44
8.0.300.0160.01018.44
8.0.290.0220.00418.44
8.0.280.0210.00518.44
8.0.270.0250.00618.44
8.0.260.0290.00018.44
8.0.250.0280.00618.44
8.0.240.0300.00318.44
8.0.230.0240.00618.44
8.0.220.0240.00418.44
8.0.210.0250.00318.44
8.0.200.0280.00018.44
8.0.190.0200.00818.44
8.0.180.0230.00518.44
8.0.170.0240.00318.44
8.0.160.0270.00018.44
8.0.150.0240.00418.44
8.0.140.0210.00618.44
8.0.130.0270.00018.44
8.0.120.0220.00418.44
8.0.110.0190.00618.44
8.0.100.0190.01118.44
8.0.90.0210.00618.44
8.0.80.0180.00918.44
8.0.70.0230.00518.44
8.0.60.0160.01218.44
8.0.50.0160.01218.44
8.0.30.0210.00618.44
8.0.20.0210.00718.44
8.0.10.0180.00918.44

preferences:
49.5 ms | 401 KiB | 5 Q