|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-05-01 15:31 UTC] dirk at rackspace dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
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); ?>