Like Pino said, if you include a file, it takes the code from the file and insterts it at the point. Therefore it inherits, as it were, the current scope of the code.

So if you include a file inside a class function then you will inherit the scope of that function, inlcuding its local variables and the scope of the class. If you include a file inside a function, it will inherit the scope of that function and all its local variables and finally if you include a file globally, you inherit all the global variables.