Re: Some PEAR remarks
| From: | Martin Jansen | Date: | Wed, 17 Apr 2002 16:11:48 +0000 |
| Subject: | Re: Some PEAR remarks | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1165@lists.php.net to get a copy of this message | ||
On Wed, 17 Apr 2002 16:43:34 +0200, Vincent Oostindie wrote:
>On Wed, 17 Apr 2002 16:35:42 +0200, Martin Jansen wrote:
>> ... A project like PEAR simply needs some
>> guidelines concerning the coding style and we will not change them just
>> because there are some people that don't like them.
>
>And rightly so! :-)
>
>I don't care very much whether you use nothing, an underscore, or an MD5 hash
>value of the variable-name as a prefix for private members (although that
>would be questionable :-)). If it's in your standard: go with it!
>
>It's just that I couldn't understand this particular one. (And still can't.)
>That's all...
Since there are no real private variables in PHP (they will be
included in Zend Engine 2), we use an underscore in front of
the variable name to tell people that are using PEAR code that
the variable is a private one and shouldn't be accessed from
outside of the PEAR classes.
So there is nothing magical around the underscores, it's just to
make the life of programmers more comfortable.
- Martin
--
Martin Jansen, <mail@martin-jansen.de>
http://www.martin-jansen.de/