note 55327 added to language.oop5.overloading

From: Date: Sat, 30 Jul 2005 19:37:40 +0000
Subject: note 55327 added to language.oop5.overloading
Groups: php.notes 
Request: Send a blank email to php-notes+get-92774@lists.php.net to get a copy of this message
This appears to be a bug: <? class buggy { private $data; function __set($key, $val) { $this->data[$key] = $val; } function __get($key) { return $this->data[$key]; } } $myObj = new buggy(); $myObj->somevar['foo1'] = 'bar1'; $myObj->somevar['foo2'] = 'bar2'; $myObj->somevar['foo3'] = 'bar3'; $boz[] = 'blah'; print_r($boz); ?> Outputs (note the foo2 and foo3 shouldn't be there): Array ( [foo2] => bar2 [foo3] => bar3 [0] => blah ) ---- Submitter IP: 64.246.30.37 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55327 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55327&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55327&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92774) next »