Re: [PHP-DEV] final keyword

2008-02-14 Thread Sebastian Schneider
This is what I'm saying. But the current grammar lacks within the use of const and final! And that's what it's all about - that's my point. ;) Lukas Kahwe Smith schrieb: On 13.02.2008, at 21:52, Andi Gutmans wrote: Guys, I think we are over-engineering and over-complicating here. Reminds me

Re: [PHP-DEV] final keyword

2008-02-13 Thread Lukas Kahwe Smith
On 13.02.2008, at 21:52, Andi Gutmans wrote: Guys, I think we are over-engineering and over-complicating here. Reminds me of all the ugly workarounds in C++. If this is really what you need then just declare it private/ protected and create accessor methods (getters/setters). I don't thin

RE: [PHP-DEV] final keyword

2008-02-13 Thread Andi Gutmans
> Cc: Felipe Pena; internals@lists.php.net > Subject: Re: [PHP-DEV] final keyword > > Hey you guys, > > but the construct > private : public $bar = 'foo'; > addresses actually another - fairly similar - issue. > > whereas I believe it's sufficient just

Re: [PHP-DEV] final keyword

2008-02-13 Thread Sebastian Schneider
Hey you guys, but the construct private : public $bar = 'foo'; addresses actually another - fairly similar - issue. whereas I believe it's sufficient just extending the const or final keyword, which introduces not a new "language construct" and thus affects really nothing but issue. Your

Re: [PHP-DEV] final keyword

2008-02-13 Thread Marcus Boerger
Hello Felipe, I do not like readonly, instead I would prefer a version where read and write have separate visibility. And actually your idea seems to prevent a second write to the value, using NULL as for detection means. Now what happens is that a) a property that has a default value will becom

Re: [PHP-DEV] final keyword

2008-02-13 Thread Felipe Pena
Em Qua, 2008-02-13 às 10:59 +0100, Sebastian Schneider escreveu: > By the way, when declared final the value couldn't be changed, anyways - > however it MUST be read-only. I made a ***simple*** (or wrong!) patch months ago for read-only property as you described. http://felipe.ath.cx/diff/readonl

Re: [PHP-DEV] final keyword

2008-02-13 Thread Sebastian Schneider
actually, the method SHOULD NOT be named get_status but getStatus :P (sorry for that, but couldn't help myself - feel free to get even ;) ) By the way, when declared final the value couldn't be changed, anyways - however it MUST be read-only. But using a method like the one you suggested is j

Re: [PHP-DEV] final keyword

2008-02-12 Thread Sebastian
Plus as it is a constant it's value cannot be changed in the context of the object. However you could implement a method for this, e.g. get_status(); which then returns an array. But the final keyword would be more comfortable "Sebastian Schneider" <[EMAIL PROTECTED]> schrieb im Newsbeitrag

Re: [PHP-DEV] final keyword

2008-02-12 Thread Sebastian Schneider
Sebastian Bergmann schrieb: Sebastian Schneider schrieb: public static final $bar = "foobar's world"; We have the const keyword for that. But doesn't work with arrays, e.g. public class Result { const DECISION_PERMIT = 0; const DECISION_DENY = 1;

Re: [PHP-DEV] final keyword

2008-02-12 Thread Sebastian Bergmann
Sebastian Schneider schrieb: public static final $bar = "foobar's world"; We have the const keyword for that. -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69 -- PHP Internals - PHP Runtime

[PHP-DEV] final keyword

2008-02-12 Thread Sebastian Schneider
Hey you guys, it would be very helpful to be able using the keyword _final_ not only for classes and methods but for variables as well - such as to prevent changes from outside though at least publicly readable. Sebastian -- PHP Internals - PHP Runtime Development Mailing List To unsubscri