Hey guys, i having problem with extended classes accessing $this variables in PHP5.
Basically i have my main classes, which holds all my classes like database, template, application functions etc. I then have my modules, and when i construct the module i pass $class into it and store it as an instance eg:
class SomeClass
{
protected $class;
function __construct( $class )
{
$this->class =& $class;
include( CLASS_PATH . 'class2.php' );
$class2 = class2( );
}
}
Then in class2 i have:
class SomeClass2 extends SomeClass
{
function __construct( )
{
var_dump( $this );
}
}
Now what happens is $this->class comes out as a null, but i want it to be the object i made an instance of. Just wondering first if this can be done, and secondly what am i doing wrong. Also if i set say: $this->someString = "this is some string", the dump will come out correctly for someString.
Thanks!