Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120131 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16882 invoked from network); 25 Apr 2023 21:40:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2023 21:40:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A50711804D5 for ; Tue, 25 Apr 2023 14:40:04 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 ; Tue, 25 Apr 2023 14:40:04 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 763985C0145 for ; Tue, 25 Apr 2023 17:40:03 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Tue, 25 Apr 2023 17:40:03 -0400 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:sender:subject :subject:to:to; s=fm3; t=1682458803; x=1682545203; bh=tLU+TKJ3Te 7ud5Zeb7HMR3lL3QP98W4hbyhta3Yv62Y=; b=UaunvkXcRvFWSoVKHLOPQqXDFZ 6PrFtjKSLBj8eFJ9w6GNKdDLySbOJ6FcLq5uwYa5BbnxTTD5It+yZfcf7gDMZ/BN IHQy3/c8tKla16Foci+3MaDXHiuJUC5pkEGtWr/aHqEvAOFoXoJwC4xd+RyNABmX isE2zFNhHd4F232YMWlsGrvvGBlfDe3/5dlLgsKr2VgblXwVOqFhs7xz6zK6RQL7 I58ngI8GAKalizTMIUcsnlA+iqrguTxFvRRM6Gh2THn94f4Oj358XB6TPMyk60I+ K9gqCNQ52dnFEjvll04Qa/lcxSEIlVP/G7BVZYvqy8FJKaTiqcyP1+8M70Lw== 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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1682458803; x= 1682545203; bh=tLU+TKJ3Te7ud5Zeb7HMR3lL3QP98W4hbyhta3Yv62Y=; b=K W214EM/8M5JXiW7U7JT3J8dSths8qWW1hbrdHuQtjugt0f5sLSM2QjeYQg+HWkQW +Wfp8ILW4yGldE9QZwJCxZGWll6TG8BiVwkKcCkUhsDKEXIbMityjTVn6Q7FyWtD +UPmcr861gulBJF79hVRrDXfWXemj8ga185SkQj1dAgz/GE+b6ky10JZHXSZeycF IbVJrypPMsGSmmykC69JLAcfOrO5D42DmZgB4KqGoFD9lVeryfP6XhtpYpcCQZb4 tGu5tSvfiXA+lG3SE4DNYvZRArxdqbgBcK8BTw2N5hxUgWnKXcV+/Wo/EfN36NFl MBrerVNGLaEaIN3msgTQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedufedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepffffffejffdugfegvedviedttedvgfejffefffej leefjeetveehgefhhfdvgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2A36D1700089; Tue, 25 Apr 2023 17:40:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-374-g72c94f7a42-fm-20230417.001-g72c94f7a Mime-Version: 1.0 Message-ID: <7701099a-cfae-488d-bc21-3553f8798fbd@app.fastmail.com> In-Reply-To: References: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> Date: Tue, 25 Apr 2023 21:39:41 +0000 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [Discussion] Callable types via Interfaces From: larry@garfieldtech.com ("Larry Garfield") On Tue, Apr 25, 2023, at 6:20 PM, Micha=C5=82 Marcin Brzuchalski wrote: > Personally I don't like this way of shaping callable types. Given exam= ples > are really confusing me. Call of a castTo() with argument representing= an > interface with a method is confusing as the method magically appears o= n a > closure without explicit binding to it! What if an interface has more = than > one method? What if I wanna choose which one? Multi-method interfaces would be explicitly disallowed and trigger an Er= ror. If providing only a single "method", then there's no logical way f= or it to satisfy a multi-method interface. But there are ample single-m= ethod interfaces around PHPlandia. And a single-method interface has no= ambiguity about which method the closure corresponds to. --Larry Garfield