Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114661 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39438 invoked from network); 28 May 2021 21:59:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 May 2021 21:59:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EE4961804CC for ; Fri, 28 May 2021 15:11:53 -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=-2.1 required=5.0 tests=BAYES_00,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-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 ; Fri, 28 May 2021 15:11:53 -0700 (PDT) Received: by mail-qk1-f173.google.com with SMTP id i67so5628813qkc.4 for ; Fri, 28 May 2021 15:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=NwN4nss12QuV8PZb25CPeLYBTHcJgecDlAAs4UxtHyI=; b=J3PJ+Z19/7LOji4rh1BZvcmpbFotdN2LImbfwuPPpOwJjQynpvoGPhOno3dMjZJ1TA IRjOnuDDwFbE0pEik9t7fSdZ6E7ierMga5zSvY6p/9nQG6PDkhpccPdAGr/He+A51yky 77wzYPV405VzOQ2oDJeqHMvxM0kx6Oj1jtDVWu8n+x1dm0YxJrSInXjPwGvlkTKXR4En mIXuLj7kr+xNHfwpJbVXFtc5/MPAsAW3QooYDx47FY98e6gFUQvW3mlneUBAXojaMhwy tp4y0RnBa0Y/x8Wgf2emlJmLgKNTbowNJ/pEDSUmHg/Fvu87y8u0ozFBstISZ0iMrtIr q+EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=NwN4nss12QuV8PZb25CPeLYBTHcJgecDlAAs4UxtHyI=; b=Ggv7ZoPYS/TUQnXSeUIxFkHIP/F7yxIb/F/3ioOMCGtRDIaG5IqW7HK8zvFa4Ug0AC NwhwL3Va8OtMXJeDLMW+aS5M04/wPPM/I9hSr+7gyNxpXVWclhCxPHbMjiS39qLy9gHg zMkzQzdi3ZillVT0DFhDnCBWmMjStDz4lokyI9lD4sKzeylpbIUjvzDdhB7jz6tk4bQ+ qDi8qtXXCfxo4YUuxKvu7pDsTUFnzVv2hbmgclzaOgggb8Pj/fsR7ChxutSoVY/IAs1A kV0oI/sWyhd2l4I3D1CRsQL96A6k7RlxijHFL0f9btEb5gBT9Bwd6YDj2E12Zp3pT8Vd mU4g== X-Gm-Message-State: AOAM532018aLmGeF+clmgCqjgddOsBgiCuAPxPje4Pn1gRpegTwnMTPg 1+eAn01NYawNmMmVQ4cayxlZw4Brst61yzcXOMs= X-Google-Smtp-Source: ABdhPJzZwHpUD6n4wJ3ZDXaDRoAUxVkYRS4j0qhEAlxzFkx+oRyAXIWMef4fRDyL5bken+h6lQaLs8dPnVJW1LRACrw= X-Received: by 2002:a37:ef05:: with SMTP id j5mr6299565qkk.203.1622239911814; Fri, 28 May 2021 15:11:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 29 May 2021 05:11:39 +0700 Message-ID: To: Nikita Popov Cc: Mike Schinkel , "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] A little syntactic sugar on array_* function calls? From: the.liquid.metal@gmail.com (Hendra Gunawan) Hello. > > The only correct way to resolve this issue is to not support mutable oper= ations. > Correct me if I'm wrong: scalar object will hit memory limit earlier than old API if it applied to $some_huge_shared_array for several method calls. > > I don't think there's much need for mutable operations. sort() and shuffl= e() would be best implemented by returning a new array instead. array_push(= ) is redundant with $array[]. array_shift() and array_unshift() should neve= r be used. array_pop() and array_splice() are the only sensible mutable arr= ay methods that come to mind, and I daresay we can do without them. > Suppose that we all agree with that. **Will scalar object preserve most of all functionality of the old API?** Some functions are very handy that keep us away from the gory detail implementation. In array case, we know that PHP array is a combination of array and plain object in JS term. There is a trend in user land PHP library that they are just copying the JS array API and poorly preserving the existing functionality of PHP old API. Implicitly, the author of this thread wants this to happen. If I am not wrong, scalar object date back to before PHP 7.0. Is there any consideration why scalar object was not escalated to the next phase, say to RFC? Regards Hendra Gunawan.