note 46906 added to language.oop5.iterations

From: Date: Wed, 27 Oct 2004 15:07:03 +0000
Subject: note 46906 added to language.oop5.iterations
Groups: php.notes 
Request: Send a blank email to php-notes+get-79189@lists.php.net to get a copy of this message
By default, all public properties will be used for the iteration is incorrect. By default, all properties the function/method has ACCESS TO will be used for iteration. What does this mean? It means that if you foreach($this) inside a class you will get private, protected, and public properties. And since there's no way to tell if a property is public or private in php5 without using reflection, well, it's a pain. ---- Manual Page -- http://www.php.net/manual/en/language.oop5.iterations.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46906 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46906&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46906&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79189) next »