Re: Re: [CFV] how to mark protected items?
| From: | Hans Lellelid | Date: | Wed, 16 Jun 2004 11:29:05 +0000 |
| Subject: | Re: Re: [CFV] how to mark protected items? | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30750@lists.php.net to get a copy of this message | ||
Stephan Wentz wrote:
Everything should be protected/private by default :) PHP5 is very nice (E_FATAL!) about letting you know when you attempt to violate access restrictions.Does PHP5 complain about these things on E_FATAL? I thought only on E_STRICT... Um, no .... E_FATAL. Try it.
And using E_STRICT with existing non-PHP5-PEAR-packages is really a pain in the $%& ;-) Yeah, which is why people are going to want PHP5 only packages.
So I think this is not reasonable, the main function of the underscore was to mark private Methods/Properties, so you don't accidently use them from outside class-context in PHP4. For protected stuff this remains the same, it can be overloaded but can't be used from outside, so i think the same marking should be done as for private stuff. On the other hand maybe it would be nice to remove all markings for PHP5 ;-) Yeah, I was just talking about PHP5 (as I think everyone is, right?). For PHP4 current coding standards make sense IMO. For PHP5 they just make sourcecode ugly (less clear IMO when every var is prefixed by _).Hans