Re: how to mark protected properties?
| From: | Tomas V.V.Cox | Date: | Tue, 08 Jun 2004 13:33:03 +0000 |
| Subject: | Re: how to mark protected properties? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30164@lists.php.net to get a copy of this message | ||
Bertrand Mansion wrote:
Tomas V.V.Cox wrote:Let's talk with some code then, 10 times slower is not a performance problem? Tomas V.V.CoxBertrand Mansion wrote:I am not sure you understand what protected is ? You can still do your > 100 loop with $this->foo = value if you need to. If you need to do a > 100 loop somewhere outside your object, just pass the values to iterate by reference as an array to your object and let it do the assignment job. I don't see a performance problem with that. Maybe a less basic tutorial could tell you about it.Tomas V.V.Cox wrote:Please read it again: "methods/calls" (replace "/" with "or"), specially the "calls". Now imagine the cost inside a > 100 loop, any basic php performance tutorial will tell you it.IMHO, as silly as sounds to prefix all vars with '_', sounds to create dozen methods/calls for getting access to those protected vars.If you are clever, all you need is 2 methods. That's called key-value coding.