3v4l.org

run code in 500+ PHP versions simultaneously
<?php $haystacks = [ ["Mac", "NT"], ["Irix", "Linux"] ]; $needle = 'Irix'; var_export( array_any( $haystacks, fn($haystack) => in_array($needle, $haystack) ) );
Output for 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
true
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31
Fatal error: Uncaught Error: Call to undefined function array_any() in /in/J17A7:10 Stack trace: #0 {main} thrown in /in/J17A7 on line 10
Process exited with code 255.

preferences:
61.24 ms | 1011 KiB | 4 Q