Re: [RFC proposal] Syntactic sugar for array push()

From: Date: Fri, 12 Sep 2025 10:34:54 +0000
Subject: Re: [RFC proposal] Syntactic sugar for array push()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-128680@lists.php.net to get a copy of this message
But we already have $array[] = 1; - are you unaware of it or is there some other benefit to what you are suggesting? What might interest people would be a syntactic sugar/shorthand for array_pop but I have no idea what that might look like. On Fri, 12 Sept 2025 at 11:21, Dušan Kreheľ <dusankrehel@gmail.com> wrote: > A proposal to add syntactic sugar for array_push() in PHP. > > Syntax: > // now > array_push($array, 1); > > // new syntax > $array[+]=1; > > Dušan Kreheľ > > -- http://about.me/kenguest/

« previous php.internals (#128680) next »