Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115356 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3605 invoked from network); 7 Jul 2021 20:42:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jul 2021 20:42:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8DDDB1804D1 for ; Wed, 7 Jul 2021 14:04:08 -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,HTML_MESSAGE, 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-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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:04:08 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id r26so7829972lfp.2 for ; Wed, 07 Jul 2021 14:04:08 -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; bh=Er1XqEMYlhUmSkaPvSWvX0/ofnrQ4l6jaOWPRTnZFq4=; b=pxOfDo5BQE4ihTBnxnKHt1eAoD9rgbV0PgUgEdrwagmCSmuv7yOTvhjyvmpOrZItRq 6AqBwzf1duIBj/6J9E51/HA4UxVMUpqT2fMnmhTTf0j7TX0H1RglSyIkVrHPZDyFq19E LyMMc4MHznAtiucXQRURzm1RGqm3kUIGOVzZwuBov1CGT/agAUOs7aPPpQ2bz0KSzIwG r7mU6GGRouPozu+0xb5NuV7yOMrmO99OjoO+E22lPyKZ5ESsTmG6/pJrFnmQLUNQquYN h6qE0pw2eNoiWq4HkynoS82zOPt2VcDYCAQrpr4QCE4XbKaBWm5dO+hLuI8+J9vxRcnf we3g== 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=Er1XqEMYlhUmSkaPvSWvX0/ofnrQ4l6jaOWPRTnZFq4=; b=diI+3Edx3Q3pEG2DU8Rb9aGAmqpNJwb+m9FBHnZlki5vBdcz7iP0I/eLnq1i+pxe5u ZGI+lRg9sEHzEzCI0nO1RvfWg9XAxiyrfMbZIEPLstIXd0YexBNhpvoTHUK2o/xxePvs Zcr4tjzq8omDVorn4/lxHhAJQTMqPqK6X8Ab6p4gHf5Kh3KMHriakVP/DnRKZIZyJeQZ a7v336sSk65LCirPNz2czxQLxr4m9BvWKoM/rrwTF/tSYUjOtJ96wJfOixa4RGX+dRAK 4h1Pubxk0YQa/p2kxjW7V1w5DF4k43av/xnvkoC8L9cX01EBnvRNF5/MzJd0RxtkMNY2 gFUw== X-Gm-Message-State: AOAM532U6olPXfqcnc2WFnhvmzvRzkuVtxKHlrmFAf0TUZw784cEmzSq rYo2Y000pZBH7esMk1gOFXe1/KVb8F06MnHYcUM= X-Google-Smtp-Source: ABdhPJzVoNYaYr9y3EoN6ncBRY+49xl1uynrmvg9O2Kqud4JtS44gHd0C45a+mymYwrsjm7FCThHlxpSMfhtvqWwgRo= X-Received: by 2002:a19:7d05:: with SMTP id y5mr20574919lfc.159.1625691846305; Wed, 07 Jul 2021 14:04:06 -0700 (PDT) MIME-Version: 1.0 References: <802fdb7d-69e5-edfa-de94-70416f9093d0@ralphschindler.com> In-Reply-To: Date: Wed, 7 Jul 2021 23:03:50 +0200 Message-ID: To: Ralph Schindler Cc: Levi Morrison , PHP internals Content-Type: multipart/alternative; boundary="000000000000036a6005c68ee1ff" Subject: Re: [PHP-DEV] [VOTE] First-class callable syntax From: nikita.ppv@gmail.com (Nikita Popov) --000000000000036a6005c68ee1ff Content-Type: text/plain; charset="UTF-8" On Wed, Jul 7, 2021 at 10:41 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. > I'm rather strongly opposed to this. MyController::myAction(...) is not callable, ergo trying to create a callable from it will fail. As I said before, performing the callability check at time of construction is a core part of this proposal, that I am not willing to compromise on. Regards, Nikita --000000000000036a6005c68ee1ff--