3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'http://example.com/site.xml', 'http://example.com/my_custom_links_part1.xml', 'http://example.com/my_custom_links_part2.xml', 'http://example.com/my_custom_links_part3.xml', 'http://example.com/my_some_other_custom_links_part1.xml', ]; $needle = 'my_custom_links'; var_export( array_filter( $array, fn($haystack) => str_contains($haystack, $needle) ) );
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array ( 1 => 'http://example.com/my_custom_links_part1.xml', 2 => 'http://example.com/my_custom_links_part2.xml', 3 => 'http://example.com/my_custom_links_part3.xml', )

preferences:
78.99 ms | 402 KiB | 62 Q