Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114704 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42958 invoked from network); 3 Jun 2021 09:17:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jun 2021 09:17:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3302E1804BE for ; Thu, 3 Jun 2021 02:31:21 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 02:31:17 -0700 (PDT) Received: by mail-ej1-f47.google.com with SMTP id jt22so8239747ejb.7 for ; Thu, 03 Jun 2021 02:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:date:from:to:cc:subject:in-reply-to:references :user-agent:message-id:content-transfer-encoding; bh=pw2RIdbsyFZ1+LaDdecWlif9kvsVMna+lRGFNesyiYo=; b=jRgW1tXZlksBny+uyqFge3rpFfUVnYVhM3NFSoOcOIm0Wyi9v+H/S9MPCaJRO9Zwf1 M4qLfGeMpo7lVNSTDjTVEvB2u8OAhnEg/2AAzMUqBbuQVbzsR8A15rzIE0BPuW78N3lU YwWM4Kqzvh4rM0omjnbwJZe2H+ngzsIfNINH5EQhkxeEBgS68HOHKUE4y6VMLF82woiy y0mCvtMIIi8bEwIcraYyWGvk9N2+YkY4x8u4jz3rXCFZOOFRs7G8bIT+6zxz4Kd527zt 7vSmvXQ4f9FoJZABNgX2T9XigdUe71GMjcSWGQtcRu0MqLWDRGDZ8wUUPPa2oL/DLrxJ RD0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:from:to:cc:subject:in-reply-to :references:user-agent:message-id:content-transfer-encoding; bh=pw2RIdbsyFZ1+LaDdecWlif9kvsVMna+lRGFNesyiYo=; b=uQDuNp68VHkBmjyyoT+H/OR3q0LFzp6qnz1Ftz6TF0wyXy+TYT7/HVg2KepZ21cJP2 92VE6WcrX3LN8walYp1IpwpH9b6aVzBTMR4HgmpHr7MAZd7e2F/Aig8JbgWJbxPe+tSL 4qFiKjWSjM0jv4NLGQmroKCKPEOUKGteIj31hEgNDBzUN4iLjg7/2oLX5SjMoY8V2Q1d eQ7+ddHljR9wl+AhVLm6PnsGQt3AdOw8w6TJGSA/bNJLivk7eb3y2X7p+XlKRJ+BUKth nSmJOGFndsO369aljTJXyv1o2Su9HLx3jIkh3eFFM4NREb+wyZSU+tIYy+sE1UPG9RUP N/JA== X-Gm-Message-State: AOAM531gHm6V3eggWskoVsQ4oZ/1c63z7rwEqQAxnqiacHDTrDX1nECL DevsQEf/Ln4JM1ZEa4Li6yA= X-Google-Smtp-Source: ABdhPJxUdj5ZvfaZrKtbYQbLPdi46UjMahuhNSCGckISNuSu/jplp5I8yu/CeaMr+CyMXDoO2NOJPw== X-Received: by 2002:a17:906:2419:: with SMTP id z25mr2547887eja.343.1622712671112; Thu, 03 Jun 2021 02:31:11 -0700 (PDT) Received: from k-piste.fi (k-piste.fi. [95.179.136.7]) by smtp.gmail.com with ESMTPSA id me11sm1270724ejb.93.2021.06.03.02.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 02:31:10 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 03 Jun 2021 12:31:09 +0300 To: Mike Schinkel Cc: internals@lists.php.net In-Reply-To: <761D99C1-4728-4EE8-95F8-44A240AE1473@newclarity.net> References: <761D99C1-4728-4EE8-95F8-44A240AE1473@newclarity.net> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: lauri.kentta@gmail.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Regarding array_shift()/array_unshift() From: lauri.kentta@gmail.com (=?UTF-8?Q?Lauri_Kentt=C3=A4?=) 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? Spread operator support in assignments would solve this nicely: [$first, ...$rest] = $array; -- Lauri Kenttä