note 55185 added to language.oop5.overloading
| From: | http://robajz dot info at osu1 dot php dot net | Date: | Wed, 27 Jul 2005 09:12:29 +0000 |
| Subject: | note 55185 added to language.oop5.overloading | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92542@lists.php.net to get a copy of this message | ||
I am deciding not to use these __get() __set() __call() PHP5 features. Look,
1) it is unpredictable it just works different, you cannot rely on it in terms of standard PHP
coding (fe. you cannot use it recursively, you cannot combine get->set, isset doesn't work
and so on...)
2) you cannot define or distinguish public / protected / private access
3) you cannot document it by standandard tools like phpDoc or docgen as well as you cannot use
autocomplete ide with this
I experienced many problems with this funny stuf. It is a nice idea, but if it worked a bit
better...
I am going to stay with basic getVarA() setVarA() as I was used to in PHP4 and that is what i
recommend you as well - especially if you are a beginner.
There can be exceptions, fe. general varying data (database query) can be accessed with this method
effectively, but think twice!
happy phping :)
----
Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55185
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55185&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55185&report=yes
Search -- http://master.php.net/manage/user-notes.php