Re: Pre-RFC Discussion: Support for String Literals as Object Properties and Named Parameters in PHP

From: Date: Mon, 02 Sep 2024 17:35:48 +0000
Subject: Re: Pre-RFC Discussion: Support for String Literals as Object Properties and Named Parameters in PHP
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-125391@lists.php.net to get a copy of this message
> On Sep 2, 2024, at 12:42 PM, Christoph M. Becker <cmbecker69@gmx.de> wrote: > > On 02.09.2024 at 16:51, Mike Schinkel wrote: > >> Generally I am one who welcomes new feature ideas, but I fear that string literals as >> object properties would break a valuable assumption that all properties must be a valid identifier. >> Without that assumption I fear many things that would become more complex. > > Is that so? See <https://3v4l.org/bZTFi>. Consider me corrected. I seem to now remember once knowing this was possible since you point it out. I think my subconscious must have caused me to repress that memory given the tragedy of it when I read Hammad's proposal. ¯\_(ツ)_/¯ >> So I am sympathetic to the desire to improve the language. However I fear this specific >> change would create more pain than pleasure. Better IMO to look for less disruptive solutions to >> achieve the same goals. For example, if the Enum+Attributes approach meets your needs aside from >> having too much boilerplate, maybe we could enhance PHP to have less of that boilerplate? > > ACK Can you elaborate on what 'ACK' means in this context? -Mike

« previous php.internals (#125391) next »