Re: private, protected, readonly, public
| From: | Marcus Boerger | Date: | Tue, 16 May 2006 23:38:18 +0000 |
| Subject: | Re: private, protected, readonly, public | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23495@lists.php.net to get a copy of this message | ||
Hello D.,
Wednesday, May 17, 2006, 1:28:26 AM, you wrote:
> Jason Garber wrote:
>> CS> Does anyone apart from me wonder why we need to bloat the language for
>> CS> an obscure feature like this? Please take a step back, take a deep
>> CS> breath, count to 10 and that's *really* what the PHP community has been
>> CS> waiting for.
>>
>> Please consider that not everyone does the same things with PHP that
>> you do - you apparently haven't run into the need for it.
>>
>> That's okay, but others have.
>>
> I'm not familiar with this OOP concept from any other language. Perhaps
> it exists, but if it doesn't, is there a reason why?
Delphi and borlands C++ have compareable semantics. They just offer much
more. And they have it for one reason: Enforcing full blown property
semantics by getter and setter methods as Java offers is simply dead slow
when you just want to prevent uncontrolled write access.
> If you add a language construct like 'readable' or 'readonly' wouldn't
>
> that almost begin to require the need for reflection functions to go
> along with it:
> is_readable($object, $key)
> Or something like that?
That is pretty secondary. And as we have a reflection extension that is
already able to reflect on anything about php i am quite sure we can add
this little piece too. Actually the code is a 4 line addon or so.
Best regards,
Marcus