Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114724 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49911 invoked from network); 4 Jun 2021 04:01:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2021 04:01:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 639FE1804CC for ; Thu, 3 Jun 2021 21:15:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 3 Jun 2021 21:15:10 -0700 (PDT) Received: by mail-qv1-f54.google.com with SMTP id 5so4388144qvk.0 for ; Thu, 03 Jun 2021 21:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UbBOPnVBbriHj71zelmbeDcAIpafuG+A+hXJprQR8KU=; b=u6dHeGR3B+mEVQ04DFvn+B7AbgwFFb/6zjJLScLHdOwy2lSOudcIjxfGSy6uZ2vZwY a2niDLO5kEhq6qfT/yNtcJYcOPpBoaqVn8eDMZehlWFfYEXRHfqzdx8f/ZJAMO2sM92l buW9YuVdYojWWvgKTah6O7QtQMEKfLvE60oOzXeasPoYiKoYX/9oKPEKO4UJmLNC/gFA uLiCMYl7isMSQa3kSMkwuB+8EHS9YUGcu8lYcI5yTdT4PAtVYe59uAf0TCcw4UK/XSIM KZWMVVTKNCsy+TUQXkwgRbsW9bZSlTmyYGX6b5q9mkZfu4jtfkwylJ3fqBNFZvHjaOyl 7F5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UbBOPnVBbriHj71zelmbeDcAIpafuG+A+hXJprQR8KU=; b=unsH1ZgX3uXeH6rxjblbm0AcvnyYhwBiWBSoqMBd0CrlfaJcnxjQOopvRC0YHMExOM 3l/iXGlN2qgjlRrbGCeAPyuKBMMEvWM1j2uSt7oA71SHsbUCsZLAhmMCW0B37jKoi2Mb 4mP/Oh7x3zLQgq++7rc8Z9gAAIU/rsxE7icED4VVUSrlLnXWBkC+LBDiQG1GFmoILTF+ yVoZCPdyhV9eJLXmM9UhJp0t5aASeHLzzxTYtj7v0P6a5U9JStxCTgSFkP1NkF9E7tCO ueewWkkjwh72si53pMzsPCtWlhcGqv9mq2jppR39avSK3ulTmUdOFxE2WNhgJmjWXb7h gC/w== X-Gm-Message-State: AOAM532PWyTt/a4zFG8Pkgo+tZMS2AQ/dEZy9XO++thzpA62N/aet3Sl UFHIsjOmomSvsXBqYo/qVqSIjA== X-Google-Smtp-Source: ABdhPJwOQJp2TrIeE0i3BQ6/rNx1JZDZ5dTKQyDbfr7Q7IkcKxr26UgPY84EFH6dxjGdbP79eKJl/Q== X-Received: by 2002:ad4:55d4:: with SMTP id bt20mr385215qvb.37.1622780109038; Thu, 03 Jun 2021 21:15:09 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id i21sm2760608qkl.20.2021.06.03.21.15.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jun 2021 21:15:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) In-Reply-To: Date: Fri, 4 Jun 2021 00:15:06 -0400 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <761D99C1-4728-4EE8-95F8-44A240AE1473@newclarity.net> To: =?utf-8?Q?Lauri_Kentt=C3=A4?= X-Mailer: Apple Mail (2.3608.120.23.2.6) Subject: Re: [PHP-DEV] Regarding array_shift()/array_unshift() From: mike@newclarity.net (Mike Schinkel) > On Jun 3, 2021, at 5:31 AM, Lauri Kentt=C3=A4 = wrote: >=20 > On 2021-06-03 01:59, Mike Schinkel wrote: >> 1.) Given Nikita's position that it would only be viable to offer a >> syntax that simulates method calling for arrays if the methods >> themselves are immutable can you envision a solution for allowing >> $array->shift() functionality that would address getting both element >> and shifted array without resorting to by-reference parameters? >=20 > Spread operator support in assignments would solve this nicely: > [$first, ...$rest] =3D $array; Excellent idea! Anyone else have thoughts on potential use of the spread/variadic = operator in array destructuring assignments? -Mike=