Replace "if (is_null($a) || $a === '')" clauses by "if (empty($a))".