replacing array_key_exists with faster isset calls

should we also change has checkers with isset() || array_key_exists() ?
fix trailing spaces on empty lines
Merge branch 'performance/#6562-isset-over-array-key-exists'

Close #6562