Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115357 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4954 invoked from network); 7 Jul 2021 20:44:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jul 2021 20:44:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2E6601804D1 for ; Wed, 7 Jul 2021 14:06:44 -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,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-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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, 7 Jul 2021 14:06:43 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id o139so5337821ybg.9 for ; Wed, 07 Jul 2021 14:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xJYIJH1M5R8rf5cOE3lMwAU3gXrniDldHgeinV/UOTM=; b=JU2vEzRfeN8yD0Tuq7UNXL/IuRVHr2HRqlLZZLLumwYRkXECyKpul9/ECU+ICyadRc gOruVBLEiLB5XvSBEV8C9u/XFCT5xkJqtKNgJLf6mt3om/LW7WDC8S9eXsF1SrfDeOmn rkV1R8Ao14h8MacnsJ74SvkLyMyeBo+EuhzWE= 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; bh=xJYIJH1M5R8rf5cOE3lMwAU3gXrniDldHgeinV/UOTM=; b=Su0m5gZrfOpTfApn+rFy1s627pCm75pEgHgNy2NVPBg7bU7rryEJwR+7slaZdgsgkZ 90sg3bv1usAokn0c7Z6RZKF6wA5wv6OSbRhaiXu4t/MNBFuumcGzbo7x2jbSm802A4DQ 46rEjU5wJdHrb/xpxZgJW75pl+sZoVM+UOzdMlTkx8qJzmwmzt8BehlqmpPnSOq8rYp3 6QXJLVfuH7CkIMJLJWt7J6YfzECBUheZUcEiAvnMzlOSG67cxP+GwiDuRzBhCfZooc9J J0K59QqktNHBlSYCu6BRSMp9b/Pgr9S6e4ZkOow1r1Sevf44Qk5aFwR6VZnTVjiw8gdY MEDw== X-Gm-Message-State: AOAM533PT7ZqFtgTzX6lWaflXeoSJ4hbgGVs138oKkhscHEiHaajM2wH dErF0iWP2D0e3OJd3TgpcaFdbQz1CZssMlKbnnv1ig== X-Google-Smtp-Source: ABdhPJzy0h2xyGiH+/dNdoPjiMUCcQ8ygjg3l790xRFHzlSz7YwR4HYBti39HBrJCwA+coIzpK9o1VhRwcuqQ3n1LCs= X-Received: by 2002:a25:e803:: with SMTP id k3mr32359164ybd.268.1625692000800; Wed, 07 Jul 2021 14:06:40 -0700 (PDT) MIME-Version: 1.0 References: <802fdb7d-69e5-edfa-de94-70416f9093d0@ralphschindler.com> In-Reply-To: Reply-To: Levi Morrison Date: Wed, 7 Jul 2021 15:06:30 -0600 Message-ID: To: Ralph Schindler Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [VOTE] First-class callable syntax From: internals@lists.php.net ("Levi Morrison via internals") On Wed, Jul 7, 2021 at 2:40 PM Ralph Schindler wrote: > > > > > > > It would theoretically be: > > > > $fn = MyController::myAction(...); > > > > It currently errors: > > > >> Fatal error: Uncaught Error: Non-static method MyController::myAction() cannot be called statically > > > > I would be okay with allowing this, as long as it's bound before it's called. > > Could we do this for 8.1? Does something of this scope need an RFC? > > I started working up a patch over the weekend, it is 1/2 done (only 7 > failing tests). > > I would really like to see this behavior come in with the (...) syntax, > as I see it as pretty valuable. > > -ralph I think this requires an RFC. The behavior of `MyController::myAction(...)` should align with `Closure::fromCallable('MyController::myAction')`, and the latter is forbidden today. We should use an RFC to support the behavior in both places. We shouldn't try to sneak it in, especially as Nikita is opposed.