note 58664 modified in language.oop5.overloading by danbrown

From: Date: Fri, 14 Nov 2008 17:18:46 +0000
Subject: note 58664 modified in language.oop5.overloading by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-146549@lists.php.net to get a copy of this message
Regarding the code posted by this user: mileskeaton at gmail dot com 23-Dec-2004 03:23 There's no need to loop over your entire object. I do this lots and all you need to do is convert the method name used into the name of a property, then check <?php if (isset($this->{$property_name})) { //Get ready to do a set } ?> I usually check if the developer called a get or set and also do some snity checking on the type of property they're requesting. --was-- Regarding the code posted by this user: mileskeaton at gmail dot com 23-Dec-2004 03:23 There's no need to loop over your entire object. I do this lots and all you need to do is convert the method name used into the name of a property, then check if (isset($this->{$property_name})) { //Get ready to do a set } I usually check if the developer called a get or set and also do some snity checking on the type of property they're requesting. http://php.net/manual/en/language.oop5.overloading.php

« previous php.notes (#146549) next »