Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125947 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 2C11C1A00BD for ; Tue, 12 Nov 2024 22:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1731450952; bh=/rqAmTJxfVAJcG/EemyLHK/ZVG3uI7QmTOtpmxFsvWg=; h=Date:From:To:In-Reply-To:References:Subject:From; b=E8Mdpnlb4HRUAH/3ZSFw3avb6DZyp5YUs7Y/1bwrzVZHprlbeT1upLqUbt/4TkdUu BZvCnIk5qPPB9bGPfqEApKDnsl03gNDejjbFZu8ceCuHHVvV1iyMj4pnQhcqD2IaRl zo2HVq2B85XpRSU0Zlm/tiRmr5BPgyKUxleed+YgQpteaFFdTHmo3fxrjTEhhRYuJ+ 7g38iixdV/R74uIRzjSx9OHYmJdoqTygulionG4HgMIcB+GGdidtZuIrL4D5poQNKv pjwkAKq2G4VfxQDEqtUR8+dIS/4vwa99VZtU6XFCprJAYL5wexbb+qN+rexr5i2s2x yn/Bc0jeYYPiw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A5D0E18003C for ; Tue, 12 Nov 2024 22:35:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 12 Nov 2024 22:35:51 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 2368F138028F for ; Tue, 12 Nov 2024 17:33:15 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Tue, 12 Nov 2024 17:33:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1731450795; x=1731537195; bh=LgJ24RjIQ+LHj/Ko483Ky Sdob5okA4Em46GMX24Ut4s=; b=xiKIAWWLGLt2tVE2+m1iZaUxDRexlWaADPkjx WZTa84Ib3+ptutLdo9IcCH9SzBXCumLl/AXw0v9lfFqb2Jxf2ujYskuSGKQQEflM oTYGKDXnNL1fmomD70kmGNM3S3hZtjLC4X5cA1gwb+/U/07vq11/xvc0S3qfxXYq SHfKZShe12+PUNj4Tn2mCPPmhENkdg+RZ5tPv6e1IXxMCmXU7a5d5etVUVR4vVuT lFFu6xG6l71K01yGJbRTWrRbYAHD7U8AEOn3SmCaaVPT/BAZ/SMwF0loi7XCNPz6 N0i7nfX+wUHmeSGCjjgb66VQ58c6omtTBpE5T/35eLssYR7uQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731450795; x=1731537195; bh=L gJ24RjIQ+LHj/Ko483KySdob5okA4Em46GMX24Ut4s=; b=nPIhMdcwddNlp6GRr 3o4j9KsRHJb23+NM2xLSiBe1pGCwzqN3mFxPwuIO+45LVAoNSZnCAQFlIzeaVbMA 4umKk1lvKDpp3iH3OhiUIhg+9mRj8j54vmpoKHLt6u+TMbRlLw7Z7fa19IQYGTSL aVw6jzgjkz9/CChe+MNSoqvwJ856/ZAur07QLtqcrf3ypFIaq0x8QN/rdVhZezF3 RoGauBWjAr9eyS5OIjIMMOk29cbC9G7gVop/352Y/ZEqQcjwv0LP/CBsjC8StP95 JSohh2GBTIykYd/xq/U8LdOTtexfjqhpVZq/Y1PvAnGLoN+ZhMAV0Lo9+awwkn14 /Oo5g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredtjeen ucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfih gvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeehjeefvefgfeduteffffdv heeiudekieefleevvdduiefgkeehvdevheffvdegteenucffohhmrghinhepghhithhhuh gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhope dupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhs thhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D2AD629C0072; Tue, 12 Nov 2024 17:33:14 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 12 Nov 2024 16:32:26 -0600 To: "php internals" Message-ID: In-Reply-To: <461FD462-72A8-42D4-B6A2-CA10AC5CA395@gmail.com> References: <461FD462-72A8-42D4-B6A2-CA10AC5CA395@gmail.com> Subject: Re: [PHP-DEV] Make Closure covariant to callable Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Nov 12, 2024, at 10:43 AM, Claude Pache wrote: >> Le 12 nov. 2024 =C3=A0 14:53, Gina P. Banyard a =C3= =A9crit : >>=20 >> Hello internals, >>=20 >> Ond=C5=99ej Mirtes (author of PHPStan) remarked to me in August that = Closure is not a subtype of callable. >> The implementation of this is quite straight forward and can be seen = on GitHub. [1] >> The question is if there are any concern or not and if this requires = an RFC or can just be merged as is. >>=20 >> Best regards, >>=20 >> Gina P. Banyard >>=20 >> [1] https://github.com/php/php-src/pull/15492 > > > Hi Gina, > > That seems reasonable. > > But personally, I would be more interested in having a type equivalent=20 > to `callable&object`, that is all objects that implement the=20 > `__invoke()` magic method (this is a strict super-type of \Closure). > > =E2=80=94Claude I am in favor of Closure being covarant to callable, and to a new pseudo= -type for Closure|Object-with-__invoke. (Maybe Invokable?) I do think = they'd require brief RFCs, but both would have my support. --Larry Garfield