I know that code is not easy to read and understand there is also much duplication in this parsing. Need to clean that up. But adding empty variables just in case they did not get defined is not better than not adding them as this would cause silent error instead of PHP warning.