#37667 [Opn->Asn]: Object is not added into array returned by __get

From: Date: Thu, 01 Jun 2006 18:54:14 +0000
Subject: #37667 [Opn->Asn]: Object is not added into array returned by __get
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97936@lists.php.net to get a copy of this message
ID: 37667 Updated by: tony2001@php.net Reported By: alexander dot netkachev at gmail dot com -Status: Open +Status: Assigned Bug Type: Class/Object related Operating System: Windows XP Sp2 PHP Version: 5.1.4 -Assigned To: +Assigned To: dmitry New Comment: Dmitry, could you plz take a look at it? Previous Comments: ------------------------------------------------------------------------ [2006-06-01 14:05:19] alexander dot netkachev at gmail dot com Description: ------------ The following code inserts only second object into property array. Reproduce code: --------------- class Class1 { protected $property = array(); function __get($name) { return $this->property; } } class Class2 {} $r = new Class1(); $r->Property[] = new Class2(); $r->Property[] = new Class2(); var_dump($r); Expected result: ---------------- object(Class1)#1 (1) { ["property:protected"]=> array(1) { [0]=> object(Class2)#2 (0) { } [0]=> object(Class2)#3 (0) { } } } Actual result: -------------- object(Class1)#1 (1) { ["property:protected"]=> array(1) { [0]=> object(Class2)#3 (0) { } } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37667&edit=1

« previous php.bugs (#97936) next »