86eb82ec2f
This is exactly what Zend's parser does now. I'm a little sad about adding the bool parameter, but all the checking code was exactly duplicated otherwise, and that seemed like the worse alternative. Fixes #854