Can't set any class/member variables in PHP?

abuzar

New Member
\[code\]class posts{ public function __construct($db) { $this->dbase = $db; $test = new post(1, $this->dbase); }}class post{ public function __construct($id, &$j) { $this->ID = $id; $this->dbase = $j; var_dump($this); // At this point, $this-ID and $this->dbase are both null. }}\[/code\]This is my issue. In the "post" class, I can dump out $j and $id and see that they are both passed perfectly. However, when I try to set $this->ID = $id or $this->dbase = $j, nothing is set. Why would this be?
 
Back
Top