Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125419 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 0B43A1A00BD for ; Wed, 4 Sep 2024 19:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725477638; bh=EBMhHoeW4LBrsBrI7PVLt9XRqPvd9MGkpz30q6uf+Qg=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=c0O1Fevx5+M8CXYxa6MUQUsS+MmdBisRL3MHvGcZZRJp/J3kPzFZx2DU32wyZQMHU ufnivT0lKSIotqF/k2OnZbEPaKYmj21arTEgqKoGTEIz7vaAfiVo1OY7ciqMVBpv3Y 4UdKyjASSLeP79W6mOTlQ8REem0vW3T0SZw0AUfTjnnrwQdN3glIkPeFjjH5IgUuMT 71f1ux9exgsTARpOPjGXRceO0NlL7TezUGq55thBZ62+KNs/Jk1SEl1eCJcayP9LeF pGC5+/70EyPoY+YD/Axv1EZuVmUAMldyzM6DCC/9aXyg6kRZci/KPgNZvgK3wQz7mK ChfL8ZPQ0zBDw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DE3618005C for ; Wed, 4 Sep 2024 19:20:37 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) (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 ; Wed, 4 Sep 2024 19:20:36 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 5307F1380171; Wed, 4 Sep 2024 15:18:38 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-03.internal (MEProxy); Wed, 04 Sep 2024 15:18:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc: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=fm2; t=1725477518; x= 1725563918; bh=EBMhHoeW4LBrsBrI7PVLt9XRqPvd9MGkpz30q6uf+Qg=; b=D KaM1/D5YwaPtbgVGEnVHKPu0vCjm1LyUlgMtNdEswdQA8mlkCq/fM8h+zSLuOxO3 hEUz67E3TkYnKi3ogEv5BCREtj/DK2NB+OvUscfO40Dc9ngZ9UHS9g16AK2PZD+t hlC9zWWM2h7DfA+HD2bABuHRS/CQpFTLyiKKXZ6NZUAOwbBK8OON4NQN2rRC/dCB Mp40wU3ej2Xb9xCBBRioRKFz7f+2aLFs+J3eahx2+JwI8x2CEBTRFauiCUi4CSfY HgCn84perjv+mUohYD5MJl+9EvqjrvMhjaFkpVtzFlyIEu0586jLGpVY1G3nfn5K h+eGW++7BGsXdYgyAOMvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1725477518; x=1725563918; bh=EBMhHoeW4LBrsBrI7PVLt9XRqPvd 9MGkpz30q6uf+Qg=; b=NDfR9iRrwTxEWQMnp6bc8+S5m7ih0wls+SIJXr+t3sU3 1rYX1XiAVOclt2QqFh08a6NgF9FwTZyFQwTaMkWdLXSWpf/Z/dLtWE43c2zWgtul TkxVXJC6ZVB2POsaKLZem4wtznui4xYxLznOPD9Sugemp3q7/BFg85097hLlaHP7 M+w15tagDHB7ktoNe4Vs8hPMO/joavUgTAiVYwWD7+cUP/OsalQKKyoIekcWTr83 oenR1R3f4p7lGwbCpS0tvc6FvAEsW5WVONnvFvo1J3U+Bc7XzBzy4Sk4pCzZrg72 rN5l0O/MBR5DQcpzr3Pio0v2CHfmRvF8ikl9NHtPiQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehjedgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvvefkjghfufgtsegrtderreertdej necuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtg houggvsheqnecuggftrfgrthhtvghrnhepieeuteehvddvfeejhffgieehleehhedthfef keejffelgfevvdekudetjeejtddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghp thhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhgrkhhosgesghhivh honhhirdgukhdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhn vght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D6C87780067; Wed, 4 Sep 2024 15:18:37 -0400 (EDT) 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: Wed, 04 Sep 2024 21:18:17 +0200 To: "Jakob Givoni" Cc: internals@lists.php.net Message-ID: <4f404d71-6581-44d6-8a87-dc6c605e0a60@app.fastmail.com> In-Reply-To: References: <2716f729-4008-4f75-8412-861d8960b746@app.fastmail.com> Subject: Re: [PHP-DEV] function autoloading v4 RFC Content-Type: multipart/alternative; boundary=cdb8721a31234491856e30d261580825 From: rob@bottled.codes ("Rob Landers") --cdb8721a31234491856e30d261580825 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Sep 4, 2024, at 17:16, Jakob Givoni wrote: >=20 >=20 > On Tue, Sep 3, 2024 at 11:49=E2=80=AFPM Rob Landers wrote: >> 1. I've removed the BC break=E2=80=94the 'type' of the autoloadee wil= l not be passed to the autoloader. This can allow someone to use spl_aut= oload for function autoloading if they so desire. >=20 > Unless I'm missing something, the main example in the RFC still shows = a function which expects the $type as the second parameter. Is that inte= ntional? Nope! Thanks for the heads-up; despite reading it four or five times, I = missed this! I've now fixed it. > =20 >> 2. I've removed artificial restrictions on the constants in which all= functions that take them can accept both at the same time and behave ap= propriately. >=20 > I'm not a big fan passing flags and using binary operations to combine= options into a single parameter.=20 > It works, but it's opaque and old-school. > We have both named parameters and enums now, can't we just use those g= oing forward, making each option a separate parameter or using enums wit= h 3 cases, FUNCTION, CLASS or BOTH?=20 Thank you for your opinion, but for cases like this, enums is probably o= ne of the worst choices IMHO. As mentioned towards the end of the RFC, I= 'd like to add further support for other things, such as constants and s= tream filters. Further, it appears that enums cannot be used in SPL (at = least, I couldn't get it to link) due to SPL having a recursive dependen= cy on itself. This is what Gina's RFC seeks to rectify by breaking autol= oading out of SPL. This RFC focuses purely on function autoloading. =E2=80=94 Rob --cdb8721a31234491856e30d261580825 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Wed, Sep 4, = 2024, at 17:16, Jakob Givoni wrote:

On Tue, Sep 3, 2024 at 11:49=E2=80=AFPM Rob Landers <rob@bottle= d.codes> wrote:
1. I've removed the BC break=E2=80=94the 'typ= e' of the autoloadee will not be passed to the autoloader. This can allo= w someone to use spl_autoload for function autoloading if they so desire= .

Unless I'm missing something, the = main example in the RFC still shows a function which expects the $type a= s the second parameter. Is that intentional?

Nope! Thanks for the heads-up; despite readin= g it four or five times, I missed this! I've now fixed it.

 
2. I've removed arti= ficial restrictions on the constants in which all functions that take th= em can accept both at the same time and behave appropriately.

I'm not a big fan passing flags and using bina= ry operations to combine options into a single parameter. 
=
It works, but it's opaque and old-school.
We ha= ve both named parameters and enums now, can't we just use those going fo= rward, making each option a separate parameter or using enums with 3 cas= es, FUNCTION, CLASS or BOTH? 

Thank you for your opinion, but for cases like thi= s, enums is probably one of the worst choices IMHO. As mentioned towards= the end of the RFC, I'd like to add further support for other things, s= uch as constants and stream filters. Further, it appears that enums cann= ot be used in SPL (at least, I couldn't get it to link) due to SPL havin= g a recursive dependency on itself. This is what Gina's RFC seeks to rec= tify by breaking autoloading out of SPL. This RFC focuses purely on func= tion autoloading.

=E2=80= =94 Rob
--cdb8721a31234491856e30d261580825--