3) { throw new Exception("Invalid number of arguments for in_array. in_arrays expects 2 or 3 parameters."); } // default to false, true if param 3 is set to true $needle = $params[0]; $haystack = (array) $params[1]; $strict = count($params) == 3 && $params[2]; return in_array($needle, $haystack, $strict); } }