PHP variables are always function local unless declared otherwise so that keeps things consistent, PHP is shit but at least they didn't try to be clever here, it looks to be as close to a Scheme-tier scoping mechanism as you'll get out of any of the scripting languages. Look at the rest of them, they have magic quantum somewhere scoping, because nobody has read SICP and their language creators are all ``opinionated'' and seek ``elegance''.