/** * Remove values from the beginning of an array using comparison * * @param array $arr The source array * @param mixed $match Values matching this value will be removed * @param boolean $strict Whether or not to use strict comparison * @return array */ public static function shiftValues(array $arr, $match = false, bool $strict = false) : array { $func = Compare::getMethod($strict); $len = count($arr); while ($len > 0 && call_user_func($func, reset($arr), $match)) { array_shift($arr); $len--; } return $arr; }