I used to think that all variables in PHP went through functions as normal. It wasn’t until I actually needed to read a global variable from a function that I realised it only has it’s own local variables. Having said that, if you need to use variables from outside of a function it is easy enough to parse through global variables.
