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.5.10.0100.01016.82
8.5.00.0120.01020.23
8.4.160.0140.00823.98
8.4.150.0020.00014.05
8.4.140.0080.01217.80
8.4.130.0070.01417.78
8.4.120.0130.00720.57
8.4.110.0110.00920.66
8.4.100.0100.01017.89
8.4.90.0030.00520.70
8.4.80.0050.00320.71
8.4.70.0130.00720.46
8.4.60.0080.00820.48
8.4.50.0120.00822.67
8.4.40.0120.00917.69
8.4.30.0100.01020.55
8.4.20.0110.01119.87
8.4.10.0090.00019.55
8.3.290.0110.00820.88
8.3.280.0110.01318.53
8.3.270.0110.00816.58
8.3.260.0110.00816.83
8.3.250.0100.01019.11
8.3.240.0050.00316.56
8.3.230.0100.00916.54
8.3.220.0100.00818.89
8.3.210.0070.00816.76
8.3.200.0060.00316.57
8.3.190.0070.00817.41
8.3.180.0100.00818.18
8.3.170.0090.00917.16
8.3.160.0040.01118.40
8.3.150.0120.00620.65
8.3.140.0040.00418.40
8.3.130.0040.00416.45
8.3.120.0080.00820.82
8.3.110.0030.00620.94
8.3.100.0000.00824.06
8.3.90.0120.00326.77
8.3.80.0060.00318.56
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.300.0100.00922.07
8.2.290.0090.00417.14
8.2.280.0120.00818.43
8.2.270.0070.01117.16
8.2.260.0030.01320.68
8.2.250.0050.00316.88
8.2.240.0070.01019.05
8.2.230.0080.00022.58
8.2.220.0040.01237.54
8.2.210.0080.00026.77
8.2.200.0070.00416.75
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.340.0140.00621.70
8.1.330.0070.00816.31
8.1.320.0070.00415.95
8.1.310.0090.00017.00
8.1.300.0090.00616.27
8.1.290.0060.00330.84
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:
29.88 ms | 403 KiB | 5 Q