Re: referencing a class

From: Date: Wed, 08 Sep 2004 09:15:53 +0000
Subject: Re: referencing a class
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-196112@lists.php.net to get a copy of this message
"Jed R. Brubaker" <jrb21398@hotmail.com> wrote in message news:20040907214107.48399.qmail@pb1.pair.com... > Quick question here. Has anyone run into trouble with a variable reference > to a class object? > > Here is the code: > $_SESSION['database'] = new Database; > $this->db = &$_SESSION['database']; > > Everything goes screwy after a call like this. > > Thanks in advance! What do you mean with "screwy"? Change $_SESSION['database'] after your second line and print out $this->db to see if that was changed too. By the way, you mean "referencing an object" (not a class). Regards, Torsten Roehr

« previous php.general (#196112) next »