Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120092 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43320 invoked from network); 20 Apr 2023 21:52:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2023 21:52:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 74D7D1804AA for ; Thu, 20 Apr 2023 14:52:25 -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 out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 ; Thu, 20 Apr 2023 14:52:24 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C7A325C00C7 for ; Thu, 20 Apr 2023 17:52:23 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Thu, 20 Apr 2023 17:52:23 -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=1682027543; x=1682113943; bh=OMHGXKaWCM 5/39TzRLh3Msv2CFRRtqyC2vZiVII/kkE=; b=ZAWAM/FkOCjDMx2KmUwDPKQtvQ gjkuCIpZ75YHzoYdAUWrpapiy2udeGy0Uuas7x0o2e+b1Xixfao1ujJM9bO4X1Sg qwnJqWfO3OOIKI1knyVpARTeTRHvqhYXuosYRCTCKtd7q6dWZy2mlypLqwzKbfSM sBHGb2mY5SFCc1WnASMxGLc1JhRXKC5+fQXc+leH9oIuh+sZTAK+3kwMzt5lipW1 rxgKPVVA6Swn2UP7paq57+895IMmQ29DvjpJBpCujonVzNvyObYlrW4UMg1OgivZ InGWJxKPksTJN89z7LxZ2yU8musFpa+1BfRV+VvDW9qOMSjf8gP50+tcudVw== 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=1682027543; x= 1682113943; bh=OMHGXKaWCM5/39TzRLh3Msv2CFRRtqyC2vZiVII/kkE=; b=X MLVoM/RDWTL9Ac9rHBuW3Tfh2FxodNTHAMvU9UXIB2NXDhiHBYWCY/AbfOIddKnY obHpNNp+dn1nYPFY3998diKancqfQVnn99c6cEsyw1nFwpTSH0SZOrNExUDOXJCK ch4LkraMUQA29LQ1513PTzDiBml4H62hd3+8GL5U40gzrKDnFegxpjW5Ww5TOSwF etxhHyksTF4NF0DEt+O3qay5arQliSURBjCL+0SPJT17+aaJYjUHwbN+tFx5lNTD 99l8c2KuBExX45eP8nyjTx39Tfp/qlzBJOdIMrC6MOSZijgA4grR+TskmaKp4U1s hoGlMTu64sPStlcXnvKZg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtfedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepffffffejffdugfegvedviedttedvgfejffefffej leefjeetveehgefhhfdvgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7E7121700089; Thu, 20 Apr 2023 17:52:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-372-g43825cb665-fm-20230411.003-g43825cb6 Mime-Version: 1.0 Message-ID: <704fdff6-77b0-48b2-a095-c04c1de381a4@app.fastmail.com> In-Reply-To: References: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> Date: Thu, 20 Apr 2023 21:52:03 +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 Thu, Apr 20, 2023, at 9:47 PM, David Gebler wrote: > On Thu, Apr 20, 2023 at 6:25=E2=80=AFPM Larry Garfield > wrote: > >> ## The options >> >> There's three ways we've come up with that this design could be >> implemented. In concept they're not mutually exclusive, so we could = do >> one, two, or three of these. Figuring out which approach would get t= he >> most support is the purpose of this thread. >> > > My initial feelings based on the options laid out is that anything whi= ch > can't support FCCs in the manner of strlen(...) is probably a non-star= ter > in terms of language design. Changes like this are fundamentally about > making things simpler, more concise and more convenient for users, not > drip-feeding a stream of "and here's yet another way of working with..= ." > features across releases. > > Structural typing option seems like the easiest to implement in the en= gine > (correct me if I'm wrong?) and probably the best syntax for the user w= ithin > the interface approach. But then do we really want to introduce new ru= ntime > checks and complexity when the general trend of the language has been = in > the opposite direction? I imagine probably not. Our assumption is the opposite: Structural typing would be the hardest t= o implement, and have the largest performance risk, but be the nicest/mo= st convenient for developers. > So out of the three, I lean towards adding castTo() to Closure and it = maybe > raises a to-be-determined Throwable if the closure is already bound? I= t's > not as friendly for the user as the other options but it seems like the > most workable, it delivers value and it most closely fits within the > existing way of working with all types of closure today. > > -Dave --Larry Garfield