Search
19 results
-
Levi Morrison via internals ·
Hi Everyone, Quite some time after mentioning the "clone with" construct the first time (at the end of the https://wiki.php.net/rfc/write_once_properties#run-time_behaviour section), finally I managed to create a working implementation …
-
Nikita Popov ·
… garfieldtech.com a écrit : 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 …
-
kocsismate90@gmail.com ·
… baz: $baz, }; } } An initial implementation is available at https://github.com/php/php-src/pull/6538 Initially, I started working on this feature because of the feedback my "Write-once properties" RFC got back then - namely that "write-once" properti
-
Rowan Tommins ·
… property accessors is lazy-loading, which I know is something you use in other forms. I had already tested the write-once properties RFC with lazy-loading: works just fine 👍 I meant that property accessors can be used to …
-
kocsismate90@gmail.com ·
… same goal, in which case please share. :-) For transparency purposes: the idea I presented during the discussion of "write-once" properties was to make the following syntax (or a similar one) possible in order to make cloning of these properties …
-
Nicolas Grekas ·
… and my proposal doesn't try to solve the same problem. Like you write in the RFC: Although actually “write-once” properties and property accessors are orthogonal to each other, it's arguable whether we still needed “write-once” properties …
-
Larry Garfield ·
… the constructor. I think what I'd expect from a possible object initializer feature is that it can't overwrite "write-once" properties with default values. (?) However, I'm ok to to remove support for default values because of the …
-
olleharstedt@gmail.com ·
… how old the dates are on those messages), so I wasn't thinking about it. An immutable class would in all practicality be the same as a class where all the properties are initonly (or writeonce, but that was al
-
terje.slettebo@sandefjordbredband.net ·
Mike Schinkel wrote: On Feb 21, 2020, at 6:17 PM, Larry Garfield larry@garfieldtech.com wrote: Separate visibility for internal and external access is a separate matter. (Also potentially useful, but not part of the write-once proposal at …
-
kocsismate90@gmail.com ·
… case, "final" or "lazy" or "locked" would be reasonable names; read-only and immutable are misleading, as it's really write-once, not read-only, not truly immutable. In the meanwhile, I realized that "immutable" is simply not true in …
-
Fleshgrinder ·
… the meaning here. See other messages of mine in this thread. Another question, which unfortunately runs straight into the previous Properties RFC: If a public property is write-once, with the intent being that it's set from the constructor …
-
tim@bastelstu.be ·
… we're thinking about this the wrong way, though? So far we've talked as though readonly makes the property write-once. But... what if we think of it as applying to the field, aka the backing value? I think …
-
Claude Pache ·
… property and write to it from any scope. Now let's jump to PHP 8.1+ with support for readonly properties. A readonly property is two functionalities in one: write-once and private set. This means that public readonly $property …
-
Claude Pache ·
… the two properties are related. All that special casing effectively means that readonly in 8.4 wouldn't really be "write once + private(set)", but "write once + private(set) - final", which is... just kinda screwy. That means our options are …
-
Larry Garfield ·
… just yet, as there's outstanding questions for which we want feedback below.) Rather than readonly being forbidden on asymmetric properties, it's better to redefine it as "write once, and if no set visibility is defined, make it private …
-
michal.brzuchalski@gmail.com ·
… public typed properties and I don't care if something would be changed in the meantime. With current RFC for write-once, I can see object initializer could be an awesome feature with a combine of read-only properties. Currently …
-
Rasmus Schultz ·
… don't have a patch - there is also no RFC, but there is general interest, I'd be happy to write one. Hi Rasmus, Am 25.04.2013 um 14:47 schrieb Rasmus Schultz rasmus@mindplay.dk: [...] What do you …
-
Rasmus Schultz ·
I second getting rid of write-onle - the only real case I can think of, is something like a password property on a user/account model-type, which gets encrypted and thus can't be read, and as Amaury pointed …
-
Benjamin Eberlei ·
On Wed, Aug 19, 2020 at 11:01 AM Andreas Leathley a.leathley@gmx.net wrote: One last change that I didn't see yesterday as it was on Github and not this list is the addition of another syntax …