Php parser

This is a work-in-progress towards fixing #195. Commits are still a bit messy, tests are still failing, code isn't completely cleaned up, but hopefully it can serve for some preliminary review or discussion. You have been warned ;-)
Why does this condition have a check for closures, but the one above doesn’t?