#23442 [NEW]: Trying to assign a reference inside an overloaded class

From: Date: Thu, 01 May 2003 20:23:30 +0000
Subject: #23442 [NEW]: Trying to assign a reference inside an overloaded class
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38894@lists.php.net to get a copy of this message
From: dirk at rackspace dot com Operating system: Redhat Linux 7.3 PHP version: 4.3.2RC2 PHP Bug Type: Class/Object related Bug description: Trying to assign a reference inside an overloaded class I was trying to assign a defined property inside an overloaded class to point at a non-overloaded class or an array. I get: Fatal error: Cannot create references to/from string offsets nor overloaded objects I understand the limitation that I cannot store references to overloaded objects - but the error message does not say references are just not allowed inside of overloaded classes. So is the error message just vague or is this a bug in the way references in overloaded classes work? Here is code that shows the problem <? $list= array(1,2,3,4); class testList { var $list; function testList(&$list) { $this->list = &$list; } } class Test { var $data; var $list; function Test (&$list) { $this->list = &$list; } function __set($name,$value) { } } // Declare the class as overloaded overload ("Test"); $test=new Test(new testList($list)); print var_dump($test->list); $list = array(1,2); print var_dump($test->list); $test=new Test($list); print var_dump($test->list); $list = array(1,2); print var_dump($test->list); ?> -- Edit bug report at http://bugs.php.net/?id=23442&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23442&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23442&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23442&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23442&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23442&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23442&r=support Expected behavior: http://bugs.php.net/fix.php?id=23442&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23442&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23442&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23442&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23442&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23442&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23442&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23442&r=gnused

« previous php.bugs (#38894) next »