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

From: Date: Sat, 13 Sep 2025 23:42:26 +0000
Subject: Re: [RFC proposal] Syntactic sugar for array push()
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-128700@lists.php.net to get a copy of this message
On 2025-09-13 22:21, Rowan Tommins [IMSoP] wrote:
On 12 September 2025 20:02:04 BST, "Dušan Kreheľ" <dusankrehel@gmail.com> wrote: Since we have an extremely well-established array_push shorthand, so don't need a new one, we could perhaps have "<" for "at start", and "-" for "pop": $foo[<] = $toUnshift; $shifted = $foo[-<];
Which looks like it would $foo[0] $foo[1] $foo[2] <-- put $toUnShift here rather than put $toUnshift here --> $foo[0] $foo[1] $foo[2]

« previous php.internals (#128700) next »