3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = ['one', 'two', 'three', 'four']; $test_needles = ['onE', 'tWo', 'THREE', 'four', 'five']; foreach ($test_needles as $needle) { printf( "%s : %s\n", $needle, array_any($haystack, fn($hay) => !strcasecmp($hay, $needle)) ? 'found' : 'missing' ); }
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
onE : found tWo : found THREE : found four : found five : missing
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Fatal error: Uncaught Error: Call to undefined function array_any() in /in/N90Nd:10 Stack trace: #0 {main} thrown in /in/N90Nd on line 10
Process exited with code 255.

preferences:
49.99 ms | 852 KiB | 4 Q