3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input= [ 'football GAME', 'cricket GAME', 'computer DEVICE', 'mobile DEVICE' ]; $needle = 'DEVICE'; $output = array_filter($input, fn($haystack) => str_contains($haystack, $needle)); var_export( [ 'filtered' => $output, 'found' => $output ? 'yes' : 'no' ] );

preferences:
171.98 ms | 406 KiB | 5 Q