note 55327 deleted from language.oop5.overloading by nlopess
| From: | nlopess@php.net | Date: | Sun, 31 Jul 2005 08:41:52 +0000 |
| Subject: | note 55327 deleted from language.oop5.overloading by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92794@lists.php.net to get a copy of this message | ||
Note Submitter: warren
----
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
)