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'));
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
array ( 0 => array ( 'name' => 'Dick Jansen', 'nameMovie' => 'Saw', 'genre' => 'Horror', 'patheMovie' => 'Texas Chainsaw 3D', 'patheMovieGenre' => 'Horror', 'score' => '100.00', ), 1 => array ( 'name' => 'Jim Scott', 'nameMovie' => 'Resident Evil Movie', 'genre' => 'Action/Horror', 'patheMovie' => 'Texas Chainsaw 3D', 'patheMovieGenre' => 'Horror', 'score' => '63.16', ), ) --- array ( 0 => array ( 'name' => 'Jim Scott', 'nameMovie' => 'Shooter', 'genre' => 'Action, Thriller', 'patheMovie' => 'The Shining', 'patheMovieGenre' => 'Horror, Suspense/Thriller', 'score' => '52.38', ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.49 ms | 402 KiB | 8 Q