PHP Require Global Scope

Kabronwf

New Member
I am having an issue in php... I don't fully understand how the whole require() thing works. My understanding is that it takes the current class's member variables and makes them global inside the required file. If this is the case, then why does it not also take the base class's member variables and make them global?baseclass.php:\[code\]class BaseClass { var $user;}\[/code\]myclass.php:\[code\]class MyClass extends BaseClass { function doSomething() { require "page.php" }} \[/code\]page.php:\[code\]$this->user // <- this is out of scope?\[/code\]
 
Back
Top