#39990 [Asn->Csd]: Cannot "foreach" over overloaded properties

From: Date: Wed, 10 Jan 2007 16:01:03 +0000
Subject: #39990 [Asn->Csd]: Cannot "foreach" over overloaded properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107428@lists.php.net to get a copy of this message
ID: 39990 Updated by: dmitry@php.net Reported By: michael dot walter at gmail dot com -Status: Assigned +Status: Closed Bug Type: Scripting Engine problem Operating System: Windows XP PHP Version: 5.2.0 Assigned To: dmitry New Comment: Fixed in CVS HEAD and PHP_5_2. Previous Comments: ------------------------------------------------------------------------ [2006-12-30 08:11:45] michael dot walter at gmail dot com Description: ------------ This is using PHP 5.2.1 RC 1 (the one Edin posted to PHP-DEV recently). Reproduce code: --------------- <?php class Klass { public function __get($name_) { return array('Hello', 'World'); } }; $obj=new Klass(); foreach($obj->arr as $value) echo $value; ?> Expected result: ---------------- HelloWorld Actual result: -------------- PHP Notice: Indirect modification of overloaded property Klass::$arr has no effect in test.php on line 11 Notice: Indirect modification of overloaded property Klass::$arr has no effect in test.php on line 11 HelloWorld ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39990&edit=1

« previous php.bugs (#107428) next »