Re: [PHP-DEV] [RFC] Readonly properties

2021-06-30 Thread Mike Schinkel
> On Jun 29, 2021, at 9:08 AM, Nikita Popov wrote: > > In any case, I don't want to include changes to cloning in this proposal -- > the topic is related, but also orthogonal to readonly properties. > Unfortunately, it will not be possible to get cloning changes into PHP 8.1 > anymore, due to

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-10 Thread Pierre Joye
On Thu, Jun 10, 2021, 2:32 PM Nikita Popov wrote: I'm not sure where you got the strange idea that "readonly" can refer to > asymmetric visibility. The two syntactic approaches to asymmetric > visibility that I'm aware of are "{ get; private set; }" in C# and "public > private(set)" in Swift.

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-10 Thread Nikita Popov
On Thu, Jun 10, 2021 at 3:21 AM Pierre Joye wrote: > Good morning Larry, > > Thank you. Very good summary, maybe worth adding to the RFC :) > > On Wed, Jun 9, 2021 at 11:52 PM Larry Garfield > wrote: > > > readonly would be a separate, independent feature/syntax. > > Yes, my thought is about

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-10 Thread Pierre Joye
On Thu, Jun 10, 2021 at 11:08 AM Mike Schinkel wrote: > > Hi Larry, > > Thanks for the response. > > > On Jun 9, 2021, at 12:51 PM, Larry Garfield wrote: > > > > Pierre and Mike: > > > > "Asymmetric visibility" as we keep referring to it would mean the "implicit accessors only" version of this:

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-09 Thread Mike Schinkel
Hi Larry, Thanks for the response. > On Jun 9, 2021, at 12:51 PM, Larry Garfield wrote: > > Pierre and Mike: > > "Asymmetric visibility" as we keep referring to it would mean the "implicit > accessors only" version of this: https://wiki.php.net/rfc/property_accessors > > That is, it would

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-09 Thread Pierre Joye
Good morning Larry, Thank you. Very good summary, maybe worth adding to the RFC :) On Wed, Jun 9, 2021 at 11:52 PM Larry Garfield wrote: > readonly would be a separate, independent feature/syntax. Yes, my thought is about self explanatory syntax matching common usage of the same

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-09 Thread Larry Garfield
On Wed, Jun 9, 2021, at 5:05 AM, Pierre Joye wrote: > Hi Nikita, > > On Fri, Jun 4, 2021 at 10:19 PM Nikita Popov wrote: > > > > Hi internals, > > > > I'd like to open the discussion on readonly properties: > > https://wiki.php.net/rfc/readonly_properties_v2 > > Very good work, thank you :) >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-09 Thread Pierre Joye
Hi Nikita, On Fri, Jun 4, 2021 at 10:19 PM Nikita Popov wrote: > > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 Very good work, thank you :) > This proposal is similar to the >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-08 Thread Mike Schinkel
> On Jun 8, 2021, at 5:18 AM, Nikita Popov wrote: > > Well, I think we can get an approximation like this: > > https://beta.grep.app/search?q=%7B%20get%3B%20private%20set%3B%20%7D[lang][0]=C%23 > > > { get; private

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-08 Thread Larry Garfield
On Tue, Jun 8, 2021, at 4:18 AM, Nikita Popov wrote: > > (Like, for example, if one had a readonly property but wanted to convert > > it to a custom accessor property... what are the subtle knock on effects > > they have to account for, then? There are almost certainly more of them > > than if

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-08 Thread Nikita Popov
On Mon, Jun 7, 2021 at 4:09 PM Larry Garfield wrote: > On Mon, Jun 7, 2021, at 4:06 AM, Nikita Popov wrote: > > On Sat, Jun 5, 2021 at 6:51 PM Larry Garfield > > wrote: > > > > Thank you for the detailed analysis in the rationale section. I am, > > > however, still skeptical of this approach,

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-07 Thread Larry Garfield
On Mon, Jun 7, 2021, at 4:06 AM, Nikita Popov wrote: > On Sat, Jun 5, 2021 at 6:51 PM Larry Garfield > wrote: > > Thank you for the detailed analysis in the rationale section. I am, > > however, still skeptical of this approach, for a couple of reasons. > > > > 1. This does appear to address

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-07 Thread Nikita Popov
On Sat, Jun 5, 2021 at 6:51 PM Larry Garfield wrote: > On Fri, Jun 4, 2021, at 10:19 AM, Nikita Popov wrote: > > Hi internals, > > > > I'd like to open the discussion on readonly properties: > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > This proposal is similar to the > >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Mike Schinkel
> On Jun 5, 2021, at 12:51 PM, Larry Garfield wrote: > > On Fri, Jun 4, 2021, at 10:19 AM, Nikita Popov wrote: >> Hi internals, >> >> I'd like to open the discussion on readonly properties: >> https://wiki.php.net/rfc/readonly_properties_v2 >> >> This proposal is similar to the >>

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Larry Garfield
On Fri, Jun 4, 2021, at 10:19 AM, Nikita Popov wrote: > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 > > This proposal is similar to the > https://wiki.php.net/rfc/write_once_properties RFC that has been declined >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Nikita Popov
On Sat, Jun 5, 2021 at 4:28 PM Benjamin Eberlei wrote: > > > On Fri, Jun 4, 2021 at 5:20 PM Nikita Popov wrote: > >> Hi internals, >> >> I'd like to open the discussion on readonly properties: >> https://wiki.php.net/rfc/readonly_properties_v2 >> >> This proposal is similar to the >>

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Benjamin Eberlei
On Fri, Jun 4, 2021 at 5:20 PM Nikita Popov wrote: > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 > > This proposal is similar to the > https://wiki.php.net/rfc/write_once_properties RFC that has been declined >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Benjamin Eberlei
On Fri, Jun 4, 2021 at 5:20 PM Nikita Popov wrote: > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 > > This proposal is similar to the > https://wiki.php.net/rfc/write_once_properties RFC that has been declined >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Pierre
Le 05/06/2021 à 12:06, Nikita Popov a écrit : Yes, this is supported. What matters is the scope from which the initialization occurs. If you rebind a closure to the scope of the class, then you can perform any operations that would be legal inside that class, including access to private

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Nikita Popov
On Sat, Jun 5, 2021 at 11:47 AM Pierre wrote: > Le 04/06/2021 à 17:19, Nikita Popov a écrit : > > Hi internals, > > I'd like to open the discussion on readonly > properties:https://wiki.php.net/rfc/readonly_properties_v2 > > This proposal is similar to

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Deleu
On Sat, Jun 5, 2021, 11:47 Pierre wrote: > Le 04/06/2021 à 17:19, Nikita Popov a écrit : > > Hi internals, > > > > I'd like to open the discussion on readonly properties: > > https://wiki.php.net/rfc/readonly_properties_v2 > > > > This proposal is similar to the > >

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Pierre
Le 04/06/2021 à 17:19, Nikita Popov a écrit : Hi internals, I'd like to open the discussion on readonly properties: https://wiki.php.net/rfc/readonly_properties_v2 This proposal is similar to the https://wiki.php.net/rfc/write_once_properties RFC that has been declined previously. One

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-05 Thread Nicolas Grekas
Hi Nikita, Le ven. 4 juin 2021 à 17:19, Nikita Popov a écrit : > Hi internals, > > I'd like to open the discussion on readonly properties: > https://wiki.php.net/rfc/readonly_properties_v2 > Thanks for the proposal, that's quite appealing! I voted "no" on the previous proposal because it

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-04 Thread Matthew Brown
This is a great idea! Might be worth mentioning that Psalm already supports a `@readonly` docblock annotation (first suggested by Nuno Maduro), and it matches the proposed behaviour (though Psalm doesn't currently prevent inheritance issues): Example: https://psalm.dev/r/7ed5872738 On Fri, 4

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-04 Thread Pierre
Le 04/06/2021 à 17:34, Pierre a écrit : Le 04/06/2021 à 17:19, Nikita Popov a écrit : Hi internals, I'd like to open the discussion on readonly properties: https://wiki.php.net/rfc/readonly_properties_v2 This proposal is similar to the https://wiki.php.net/rfc/write_once_properties RFC that

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-04 Thread Pierre
Le 04/06/2021 à 17:19, Nikita Popov a écrit : Hi internals, I'd like to open the discussion on readonly properties: https://wiki.php.net/rfc/readonly_properties_v2 This proposal is similar to the https://wiki.php.net/rfc/write_once_properties RFC that has been declined previously. One

[PHP-DEV] [RFC] Readonly properties

2021-06-04 Thread Nikita Popov
Hi internals, I'd like to open the discussion on readonly properties: https://wiki.php.net/rfc/readonly_properties_v2 This proposal is similar to the https://wiki.php.net/rfc/write_once_properties RFC that has been declined previously. One significant difference is that the new RFC limits the

Re: [PHP-DEV] [RFC] Readonly Properties

2014-11-03 Thread Andrea Faulds
On 24 Oct 2014, at 00:36, Andrea Faulds a...@ajf.me wrote: Here’s another RFC: https://wiki.php.net/rfc/readonly_properties After further though, I am withdrawing this RFC. It’s confusing and a half-baked solution to the problem. Also, I’m not sure I like the idea of variable visibility

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-29 Thread Andrea Faulds
On 29 Oct 2014, at 04:29, Jordi Boggiano j.boggi...@seld.be wrote: Yup that's definitely better than having the readonly flag in the {} block as I had it. I'd however say that it should be possible to define a writable property with only a getter and then the setter would implicitly be

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Jordi Boggiano
On 27/10/2014 20:27, Andrea Faulds wrote: Tentative syntax. But this way, the visibility stays on the left. I think that’s good for readability. If you omit the second specifier, then the first one applies to getting and setting, as now. If you include it, the first one applies to getting,

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Pierre Joye
On Tue, Oct 28, 2014 at 2:17 PM, Jordi Boggiano j.boggi...@seld.be wrote: On 27/10/2014 20:27, Andrea Faulds wrote: Tentative syntax. But this way, the visibility stays on the left. I think that’s good for readability. If you omit the second specifier, then the first one applies to getting

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Chris Wright
On 27 October 2014 20:27, Andrea Faulds a...@ajf.me wrote: On 26 Oct 2014, at 19:16, Rowan Collins rowan.coll...@gmail.com wrote: I just had a thought on both the naming and future-proofing concerns of this proposal: what about pre-emptively reserving the skeleton of the syntax needed

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Rowan Collins
Jordi Boggiano wrote on 28/10/2014 07:17: How about this instead for readonly: public $foobar { get { return $this-bar * $this-foo; }; readonly } And if the flag isn't there, set is implicitly present. That'd mean you also can keep public readonly $foobar; as a

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Rowan Collins
Chris Wright wrote on 28/10/2014 09:46: I would suggest something like this: public $foobar { get { return $this-bar * $this-foo; } private set($value) { $this-bar = $value / $this-foo } } ...where only a single visibility modifier is permitted on the left, and this is treated as the

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Andrea Faulds
On 28 Oct 2014, at 07:17, Jordi Boggiano j.boggi...@seld.be wrote: I like it, except for the fact that if you add a custom getter to a property suddenly it becomes readonly unless you remember to add ; set to the end of the block, right? Well, no. If you choose to specify getters and

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Andrea Faulds
On 28 Oct 2014, at 09:46, Chris Wright c...@daverandom.com wrote: Sorry, but I don't like this. This means that the visibility modifier is no longer next to the thing that it applies to, I wouldn’t say that. The visibility modifier is an aspect of the property itself, not its

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Rowan Collins
Andrea Faulds wrote on 28/10/2014 14:08: On 28 Oct 2014, at 07:17, Jordi Boggianoj.boggi...@seld.be wrote: I like it, except for the fact that if you add a custom getter to a property suddenly it becomes readonly unless you remember to add ; set to the end of the block, right? Well, no. If

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Andrea Faulds
On 28 Oct 2014, at 14:24, Rowan Collins rowan.coll...@gmail.com wrote: Andrea Faulds wrote on 28/10/2014 14:08: On 28 Oct 2014, at 07:17, Jordi Boggianoj.boggi...@seld.be wrote: I like it, except for the fact that if you add a custom getter to a property suddenly it becomes readonly

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Jordi Boggiano
On 28/10/2014 15:08, Andrea Faulds wrote: On 28 Oct 2014, at 14:24, Rowan Collins rowan.coll...@gmail.com wrote: Andrea Faulds wrote on 28/10/2014 14:08: On 28 Oct 2014, at 07:17, Jordi Boggianoj.boggi...@seld.be wrote: I like it, except for the fact that if you add a custom getter to a

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Dmitry Stogov
Hi Andrea, I don't have strong opinion about this proposal. It doesn't make any harm to the engine, and it really may speed-up code especially written for read-only properties. On the other hand you introduce new orthogonal to private/protected/public visibility rule, and I'm not sure if this

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Andrea Faulds
On 27 Oct 2014, at 18:31, Dmitry Stogov dmi...@zend.com wrote: Hi Andrea, I don't have strong opinion about this proposal. It doesn't make any harm to the engine, and it really may speed-up code especially written for read-only properties. On the other hand you introduce new orthogonal

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Dmitry Stogov
On Mon, Oct 27, 2014 at 10:25 PM, Andrea Faulds a...@ajf.me wrote: On 27 Oct 2014, at 18:31, Dmitry Stogov dmi...@zend.com wrote: Hi Andrea, I don't have strong opinion about this proposal. It doesn't make any harm to the engine, and it really may speed-up code especially written

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Andrea Faulds
On 27 Oct 2014, at 19:47, Dmitry Stogov dmi...@zend.com wrote: Oh. I meant static properties, of course. (zend_compile.c line 4219) So did I in the second paragraph. Static property get and set currently goes through the same function… but really the reason they’re disallowed is me not

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Andrea Faulds
On 26 Oct 2014, at 19:16, Rowan Collins rowan.coll...@gmail.com wrote: I just had a thought on both the naming and future-proofing concerns of this proposal: what about pre-emptively reserving the skeleton of the syntax needed for accessors, without actually implementing them? I’ve been

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-27 Thread Dmitry Stogov
if there are no conceptual and implantation problems with static readonly properties, it's better to implement them in the same patch. On Mon, Oct 27, 2014 at 11:15 PM, Andrea Faulds a...@ajf.me wrote: On 27 Oct 2014, at 19:47, Dmitry Stogov dmi...@zend.com wrote: Oh. I meant static

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-26 Thread Jordi Boggiano
On 24/10/2014 12:54, Andrea Faulds wrote: On 24 Oct 2014, at 10:29, Jordi Boggiano j.boggi...@seld.be wrote: Thanks for the work (again). It's an interesting small idea but I'd much prefer revisiting the original getter/setter RFC [1] which had a majority but just fell short of the 66%

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-26 Thread Rowan Collins
On 24/10/2014 00:36, Andrea Faulds wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes. Since I am a big proponent

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrea Faulds
On 24 Oct 2014, at 06:09, Xinchen Hui larue...@php.net wrote: so you prefer to expose the name of the property anywhere? let's say you expose a readonly int value name iSize.. but later, the value also need to be a double, then you also prefer add another dval? (since you can not

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Rowan Collins
On 24 October 2014 00:36:35 GMT+01:00, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes.

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrey Andreev
Hi, On Fri, Oct 24, 2014 at 2:36 AM, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Patrick Schaaf
Am 24.10.2014 01:36 schrieb Andrea Faulds a...@ajf.me: Here’s another RFC: https://wiki.php.net/rfc/readonly_properties +1 for the general feature, I'd love to have that available. I have an idea regarding the additional keyword, with a small implication (improvement) to the functionality

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Jordi Boggiano
On 24/10/2014 00:36, Andrea Faulds wrote: Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes. Since I am a big proponent of including specification

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Pierre Joye
hi Andrea, On Fri, Oct 24, 2014 at 6:36 AM, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Nikita Popov
On Fri, Oct 24, 2014 at 1:36 AM, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes.

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Alain Williams
On Fri, Oct 24, 2014 at 10:41:38AM +0200, Patrick Schaaf wrote: Am 24.10.2014 01:36 schrieb Andrea Faulds a...@ajf.me: Here’s another RFC: https://wiki.php.net/rfc/readonly_properties +1 for the general feature, I'd love to have that available. I have an idea regarding the additional

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Florian Margaine
Hi, On Fri, Oct 24, 2014 at 12:21 PM, Alain Williams a...@phcomp.co.uk wrote: On Fri, Oct 24, 2014 at 10:41:38AM +0200, Patrick Schaaf wrote: Am 24.10.2014 01:36 schrieb Andrea Faulds a...@ajf.me: Here’s another RFC: https://wiki.php.net/rfc/readonly_properties +1 for the general

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Alain Williams
On Fri, Oct 24, 2014 at 12:29:57PM +0200, Florian Margaine wrote: Finally we could bring it all together and sidestep the scoping keywords using 'var' instead. Thus: var $callback as 0751; Would define a property that contains an anonymous function that could be called by

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrey Andreev
Hi, On Fri, Oct 24, 2014 at 12:34 PM, Pierre Joye pierre@gmail.com wrote: hi Andrea, On Fri, Oct 24, 2014 at 6:36 AM, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation,

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrea Faulds
On 24 Oct 2014, at 10:29, Jordi Boggiano j.boggi...@seld.be wrote: Thanks for the work (again). It's an interesting small idea but I'd much prefer revisiting the original getter/setter RFC [1] which had a majority but just fell short of the 66% mark. This RFC only implements parts of

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrea Faulds
On 24 Oct 2014, at 11:20, Nikita Popov nikita@gmail.com wrote: While I think the functionality behind this proposal is nice in principle, I have two objections with the RFC: 1. It uses the readonly modifier, to refer to a property that is publicly readable, but protectedly writable

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrea Faulds
On 24 Oct 2014, at 12:12, Andrey Andreev n...@devilix.net wrote: Pierre, I rarely disagree with you, but this is one such case. It is true that we can look at this as a partial solution to a bigger problem, or as you said - a baby step. However, I see this as the perfect solution for a

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Andrea Faulds
On 24 Oct 2014, at 12:59, Andrea Faulds a...@ajf.me wrote: 2. If the aim of this RFC is to replace the getFoo() pattern with the use of readonly public $foo properties, a primary difference will be that a getFoo() method can be declared in an interface, whereas a readonly public $foo

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Stas Malyshev
Hi! Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes. For me, this seems both too big and too small. Too small, because if you really it

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Kalle Sommer Nielsen
2014-10-24 7:09 GMT+02:00 Xinchen Hui larue...@php.net: so you prefer to expose the name of the property anywhere? let's say you expose a readonly int value name iSize.. but later, the value also need to be a double, then you also prefer add another dval? (since you can not simple change

[PHP-DEV] [RFC] Readonly Properties

2014-10-23 Thread Andrea Faulds
Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different scopes. Since I am a big proponent of including specification patches in new

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-23 Thread Xinchen Hui
Hey: On Fri, Oct 24, 2014 at 7:36 AM, Andrea Faulds a...@ajf.me wrote: Good evening once again, Here’s another RFC: https://wiki.php.net/rfc/readonly_properties It proposes, with a working implementation, a modifier for properties that makes them readable and writeable from different

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-23 Thread Kalle Sommer Nielsen
Hi 2014-10-24 5:02 GMT+02:00 Xinchen Hui larue...@php.net: Hey: -1 on this. Actually, your example for explaining usage.. I don't see why it is must, add a getSize() will also meet the needs, and more beatiful, as you can change $size to another name if you like later. I

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-23 Thread Xinchen Hui
On Fri, Oct 24, 2014 at 12:11 PM, Kalle Sommer Nielsen ka...@php.net wrote: Hi 2014-10-24 5:02 GMT+02:00 Xinchen Hui larue...@php.net: Hey: -1 on this. Actually, your example for explaining usage.. I don't see why it is must, add a getSize() will also meet the needs, and