Check isset() first. It's much faster in foreach loops.
Merge pull request #1 from bendiy/master

Check isset() first. It's much faster in foreach loops.