Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114628 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29795 invoked from network); 26 May 2021 21:57:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 May 2021 21:57:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B04461804D9 for ; Wed, 26 May 2021 15:09:36 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 ; Wed, 26 May 2021 15:09:36 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B99AF5C00F5 for ; Wed, 26 May 2021 18:09:34 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute3.internal (MEProxy); Wed, 26 May 2021 18:09:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=+zUAX9 S+c+wG9xyT51rfr3hZ1XNxst4//YOnFEWWyRk=; b=L7qCYPa31BI//n+7HY61MN b/0OmFeG43u3vtNl27/9yGkSM72KYVthQlY1E3u+qGsAuBw9Vx7IUvO1rVEg22CQ UVvUI3CZa8u6fkozcIsYOoh5Ytl1KATsBtszkeP/aRvYzWIxfN5oztcHzwIWxbH/ wVKoMO/02HomqIEN/A9OYbuT6JusBxb6cWmQzvGrxT/9A6wvCBrbfN/RXSec76ma jq+zoVLjongorzdkRGP/xhGoWLSOUxWQ/LJzf1s3nbVfQiWR8c5eymbN0FpG5v7p GA4ULhkSUgf9LPBpyr1O/N9JlKUsFLzmTzFa6JP/yCmxzVFmxhCx7RyR1hvXFSsA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekgedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6F0953A0427; Wed, 26 May 2021 18:09:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-ID: <741d3807-160a-462e-a9c9-a830aff74631@www.fastmail.com> In-Reply-To: References: Date: Wed, 26 May 2021 17:07:40 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] A little syntactic sugar on array_* function calls? From: larry@garfieldtech.com ("Larry Garfield") On Wed, May 26, 2021, at 4:31 PM, Sara Golemon wrote: > On Wed, May 26, 2021 at 2:36 PM Mike Schinkel wrote: > > > On May 26, 2021, at 2:34 PM, Sara Golemon wrote: > > > > > > What I don't like about the specific proposal is that it's just a little > > too magic in its function selection and argument mapping. There's also the > > fact that it doesn't leave room to improve specifics about the > > implementations of the methods. I'd much rather seen an `Array` class > > defined with specific methods declared on it. > > > > > > Wouldn't an `Array` class necessarily result in array-incompatible > > pass-by-reference semantics, which is one of the same issues with userland > > using ArrayObject as an array replacement? > > > > > It would if the Array objects got returned. I'm instead picturing an > instance that magically comes into being solely for the duration of the > method call. Once the method returns, the object vanishes. > > -Sara It sounds like you're describing something more akin to "extensions" in C#, or the way trait impls work in Rust, or the way methods get defined in Go. (All of which would be quite neat, but I don't know how they'd play nicely in PHP.) --Larry Garfield