3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $haystack = array(1,2,3,4,5,6,7,8,9,10); $needle = array(3,4,5); $bad_needle = array(3,5,4); $offset = array_search($needle[0], $haystack); $slice = array_slice($haystack, $offset, count($needle)); if ($slice === $needle) { echo 'yes'; }
Output for 4.3.0 - 7.1.0
yes