Why don't you just do `return !is_null($p) && $p !== ''` in the closure? Or even `return !empty($p)`?