Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115376 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68830 invoked from network); 9 Jul 2021 09:29:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Jul 2021 09:29:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C697B1804C8 for ; Fri, 9 Jul 2021 02:51:51 -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-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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, 9 Jul 2021 02:51:51 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id v14so22195890lfb.4 for ; Fri, 09 Jul 2021 02:51:51 -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=uqUR/9G0SLgHoFPjQqK8ZMiThxR+aYC8UUm77LLQeug=; b=BMSs5wIuwFOCmJf9Jh89ayC9us1dTtYwYiTO64IZbfHzFl6iEGk5r7/vP/Kb0tGyUH UILG5z7c498oof63NM9+sEB8BjIx6zP94N80iTyJm+wPMp3GiTGpcNxIX1h4tLOCrGUt dLW6qFDPCa905JwZlDTlbW8Kl5m4AkEETzdXWWVRdChtF4bfmXKq9zgCGyJArF7niZOL Eb3wzo291CISzWZpYenNNe5w58vjk/Ua9mrpV8OOeo4Wu9X0hiAL9SK9JKAW/Z8BrDIl NhEmohjDCNURigxEossdvTY0+nBBONuK7G1yBgNHzCxBVU2HUaPtM3InHC+sZFmy6x2L /K5g== 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=uqUR/9G0SLgHoFPjQqK8ZMiThxR+aYC8UUm77LLQeug=; b=Quc0aoLPGgWs4A306k96+Zm08Vf3Q1JruGJ7VyJllWjIZ6WPaH4XJLtbin+5vqG63+ Xcnx3gvC/qpk0kdY/Y1lp20WKcy4wXiQjWBMWaVUmWDo0PJFDXw+TkPhve+mvRPuCC0H 1XewaLiFXAwmP66SxOMENYoorG6ptxR5nvQQ5WS6TRzJTGV/7TzOv9bNDWaYxugyx/sP L3vPG2DHZkcL/hmltKMVDlZxp/OGMk6d5q54N19iGDfLYFf0uzgv53ZySptLlEwDl12j D7y9fkTVcY25OpL2hpLE4A4zyDTtxL6s54lUog3lpKWSONNjwhcFrtlh7DEU4oLb4T5U Phjg== X-Gm-Message-State: AOAM533WQm4kUU4Gm3V0ahhZFCZnV+G/X8IuVHAZ7nM5dcAZqhijyIBU TtIH8S4dOLcGyD1DvJTZIHA+TQRHCQqiDGf63Dg= X-Google-Smtp-Source: ABdhPJyAnDEtpyls5Ow3VHJubod8QaVErRdADWN5LRLWPNVQHw/rZ9kM5T3YFzaRJJVBWX5KaRA6aVHra60pl8FSySM= X-Received: by 2002:a05:6512:32c9:: with SMTP id f9mr27608986lfg.638.1625824307632; Fri, 09 Jul 2021 02:51:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 9 Jul 2021 11:51:31 +0200 Message-ID: To: Joe Watkins Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000052dd0d05c6adb8d0" Subject: Re: [PHP-DEV] Fake Closure Comparison From: nikita.ppv@gmail.com (Nikita Popov) --00000000000052dd0d05c6adb8d0 Content-Type: text/plain; charset="UTF-8" On Fri, Jul 9, 2021 at 10:45 AM Joe Watkins wrote: > Morning internals, > > While discussing some of the details of the first class callable RFC, it > became apparent that fake closures (created by Closure::fromCallable) are > not currently comparable in a useful way. > > Although this is not directly related to the first class callable feature, > it's likely that the proliferation of this kind of code will follow, so now > seems like a good time to fix the problem. > > https://github.com/php/php-src/pull/7223 > > Any objections to merging that in master ? > To clarify: What this implements is that $strlen1 = Closure::fromCallable('strlen'); $strlen2 = Closure::fromCallable('strlen'); var_dump($strlen1 == $strlen2); // bool(true) with this patch, previously bool(false) The same would also apply to the first-class callable syntax, i.e. after this patch strlen(...) == strlen(...) would return true. Regards, Nikita --00000000000052dd0d05c6adb8d0--