Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118404 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92072 invoked from network); 10 Aug 2022 19:28:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Aug 2022 19:28:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E79F31804AF for ; Wed, 10 Aug 2022 14:30:46 -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.8 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,MISSING_HEADERS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 10 Aug 2022 14:30:46 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id r1-20020a05600c35c100b003a326685e7cso2034913wmq.1 for ; Wed, 10 Aug 2022 14:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:from:to:cc; bh=8Avl+tex9JrVXcJUYX3jg8ojvgfLa4E9+Xi+noZ7oyI=; b=aitfmHDH07ARml2mRK+2RH1f3eK9sU+IXQvYlxNhTxwGciP68l7sdVRDV9WMs0gu1R MWFIBDoPHKrJarKpF6eI/3MUBj+JEqdpZKikPpbIOVRIfMHs08xRLNZYviRKGmfK5qdT VBnq5sSrIWq128Ji1lE16vAsj1PeLJ0srjnjxTuW5yRyYUM0nda1eXU6csaw1HnQ8Qsi Vr6ihmJxz0fSq25QamYVX49REMl1VXhL+epc2IeJhb8G0gHPn+PsqX+j+3wNVrGzz4tI +74tC/wFjvNLV3TfbsTLSwalR7rfZRWYGdE1PHkt5kN0IpuPIGVLbpLF29oNUC2y6Esh L3fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:x-gm-message-state:from :to:cc; bh=8Avl+tex9JrVXcJUYX3jg8ojvgfLa4E9+Xi+noZ7oyI=; b=qaLJjgZMC7KCJoBmyaTEdHdfm8uDCQY6VDIZMpm3ZmWcQtD3913braWirTKvK25E3n g6uAzV0l3XPLE6fUnoXG6kKOWdXWugu/8GyQEY0X6fUsskVtOhqeidEuE2J0MFDR17PH wSFpuMGgC2quESBvZdlN/5RzQaXK+jPgrfU3c8XXyyQoQcSK31KilO48hAdE5WyqR3Rt TJNypASLw6bPY7W4PtTnlHNKz3durX01OyQ/jWHaOANEoE779W/BVFYNpnG4wfQa5Ms5 g4BHpb3TjcjdkHUU6mD8Zu2qM9xL2aWD4EDVHRZVCr3rRopBSpE4c5ZoKTE+s9bz6TMJ h6Tw== X-Gm-Message-State: ACgBeo3G3I3p8BJq8S00TaWZ+HO4W1/CtqlTZn5oAz3C6/wAIOcRf7mn HuhzcZlZHsUspB+TQD5JDO74PQRExjA= X-Google-Smtp-Source: AA6agR68fRDfblwtM1186o5haGAwQjeg64qkYpY4SzpR/rNMlTTrAghcccq31phkpJ1xgJibgrL/Fw== X-Received: by 2002:a05:600c:3543:b0:3a5:bc93:250 with SMTP id i3-20020a05600c354300b003a5bc930250mr173935wmq.188.1660167045379; Wed, 10 Aug 2022 14:30:45 -0700 (PDT) Received: from [127.0.0.1] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id s4-20020a05600c384400b003a4eea0aa48sm3832025wmr.0.2022.08.10.14.30.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 14:30:44 -0700 (PDT) Date: Wed, 10 Aug 2022 22:30:42 +0100 CC: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: <62f3da67.810a0220.ed5e8.1b2cSMTPIN_ADDED_MISSING@mx.google.com> Message-ID: <17C7EF67-298D-40E8-A872-5A9D78A7EEDA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [Concept] Extension methods From: rowan.collins@gmail.com (Rowan Tommins) On 10 August 2022 18:52:58 BST, Alex Wells wrote: >Thanks for explaining it better than I did=2E > >Regarding the implementation, that was roughly what I was thinking=2E > >But can't we put extension methods second, after real methods but before >__call? As far as I understand, the reason to put it after __call is to >avoid a performance penalty on __call calls, but this would mean extensio= n >methods are not possible for classes that implement __call=2E Not a huge >deal, but a thing to consider=2E To be honest, I put them in that order more for "purity" reasons: if they = come before __call, they can change the existing behaviour of the class, by= defining an extension method with the same name as a "virtual" method impl= emented with __call=2E That then becomes a very different feature=2E If there was a way for __call to signal "no implementation for this method= name", you could look for extension methods if that was returned; but at t= he moment, a class implementing __call is assumed to reserve *all* method n= ames=2E I suppose a related question is whether __call itself could be implemented= by an extension method=2E I would suggest no, to keep things simpler=2E (Aside: Reminder that convention on this list is to "bottom-post": quote t= he part of message you're replying to, then add your text below=2E) --=20 Rowan Tommins [IMSoP]