PHP 4.0 Bug #6231 Updated: Reference parsing problem

From: Date: Fri, 18 Aug 2000 10:21:34 +0000
Subject: PHP 4.0 Bug #6231 Updated: Reference parsing problem
Groups: php.dev 
Request: Send a blank email to php-dev+get-29380@lists.php.net to get a copy of this message
ID: 6231 Updated by: waldschrott Reported By: rezinkin@mail.ru Status: Analyzed Bug Type: Scripting Engine problem Assigned To: Comments: There´s really some problem here, I´ve cut down the code to illustrate the problem. After calling settype() on an already existent object (really don´t needed) named $this->prop, settype() changes that property to a reference (see var_dump() output)... apparently to a reference to the equivalent property of another object, I can´t imagine that was intended... perhaps zend tried to be smart in any way... class BOMainstr{ } class BOMain2{ function BOMain2 () { $this->storage = new BOMainstr(); var_dump($this->storage);var_dump($this); settype($this->storage,'object'); var_dump($this->storage);var_dump($this); } function get() { return $this->storage->ID; } function set($ID) { $this->storage->ID = $ID; } } $C = new BOMain2(); $C->set(1); $D = $C; $D->set(2); echo "C->get() =>" . $C->get() .'<BR>'; echo "D->get() =>" . $D->get(); ?> Full Bug description available at: http://bugs.php.net/?id=6231

« previous php.dev (#29380) next »