Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125445 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 6538D1A00BD for ; Thu, 5 Sep 2024 20:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725570035; bh=rr55ucs99364Ais4Hzf63Wm2fU79VPRlfPJGMFDqZE8=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=jONkBYV58KG43mo/s3U8S6C/bjpCFvt2iIhLjmvNsdXz9Uf0NXjuIlHkKsndBA6fW EtYk6UgWYl8LF/2gUCJ12nEPlfYDZCQGOpm8TtV5S5K+UXMxxwV1Z18xiLHC6jxb9O +OcLJkREb7lh+6Wy80Zh5v8OP3C2zh6EIz/fe1NJ50ghumORO57faCSH7jDVF8NVao bpzwjQ5RXW++vk8VPwI5rWQDernt5cEcmW04m8m264qiDSI8mxLv/dBgMD/mHAOE7l joyPmVDOka9pEiLoG5YNlPLL1cn3YUJPF1bOTS5Z9lVuiPnQy4a6VNDwt3yJRZYwWC tmVsoDoWYhiZg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F1BA6180032 for ; Thu, 5 Sep 2024 21:00:34 +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 fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (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 ; Thu, 5 Sep 2024 21:00:34 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8E6781140276; Thu, 5 Sep 2024 16:58:35 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-03.internal (MEProxy); Thu, 05 Sep 2024 16:58:35 -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=1725569915; x= 1725656315; bh=rr55ucs99364Ais4Hzf63Wm2fU79VPRlfPJGMFDqZE8=; b=x S/ci/6jjxRRcKs39/beFsRuDqFCBtW3YP9d4mddm/39Nh/5ccODrCNz+Jzif7Kc/ EGtqWjp0CubMzjCACQXHNO2Y8jntxZA8/d+hJ75505x3cRfxoQjJ/wqBoe8Mo5hS Zxy0tzeiMmw4ei/GUxQBF/DiD2av4nhdtOg3XJa3hiQ3cew7tKhFZtZeUcPSgeeF bFDCh3WCgLmKJdO3ooLnfWLhWZVSZNJQqJvEfEw6M9HMb2r36qL22Csra5sQbSJv PBdYQbz+KmcfHUj6VRpxqKF674Tgm1ZbKGwrQPu9LmmhZRDTKDfCoZ5qtyK+ZrR2 pe/Sr5S1kojn0obkEMKjw== 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=1725569915; x=1725656315; bh=rr55ucs99364Ais4Hzf63Wm2fU79 VPRlfPJGMFDqZE8=; b=qL2pH9nJj66JBlPjgaja30dP0ExJQwFOLX0TczQ1bsrL XIp+uy+Uggzl0Jrh67z05qXFMHhlGf8Ysb8YSBA+LNuhnuLYq0+vjgCfZe7dBhw+ daIu3Bi2UXW3Yv6XBXgfZqIre+/mA2Co0S8jtejRDlXgll7A8AFsDWsW7BSIgph+ YIHz56VcQfqquTC3NZ5rDurf7sTDyNjjOrLSuTMK8zQIBCMBovTYmFrUAtxRgPBg fQhuiEyasWg6K0itfhMaYxVxER2Xn1Ot6y2hZPsKi3GE7oItlCLBFZeTVzuOA6Ih UN79eic9VwrLKujBxgVE+KAmzlkGTU5ECPvh/UJcwQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehledgudehhecutefuodetggdotefrod 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 462D2780067; Thu, 5 Sep 2024 16:58:35 -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: Thu, 05 Sep 2024 22:58:14 +0200 To: "Jakob Givoni" Cc: internals@lists.php.net Message-ID: In-Reply-To: References: <2716f729-4008-4f75-8412-861d8960b746@app.fastmail.com> <4f404d71-6581-44d6-8a87-dc6c605e0a60@app.fastmail.com> Subject: Re: [PHP-DEV] function autoloading v4 RFC Content-Type: multipart/alternative; boundary=8c4240e9a7c143e380441bdddb3e4abe From: rob@bottled.codes ("Rob Landers") --8c4240e9a7c143e380441bdddb3e4abe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Sep 5, 2024, at 21:03, Jakob Givoni wrote: >=20 >=20 > On Wed, Sep 4, 2024 at 9:18=E2=80=AFPM Rob Landers = wrote: >> __ >> On Wed, Sep 4, 2024, at 17:16, Jakob Givoni wrote: >>> =20 >>>> 2. I've removed artificial restrictions on the constants in which a= ll functions that take them can accept both at the same time and behave = appropriately. >>>=20 >>> I'm not a big fan passing flags and using binary operations to combi= ne 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= going forward, making each option a separate parameter or using enums w= ith 3 cases, FUNCTION, CLASS or BOTH?=20 >>=20 >> Thank you for your opinion, but for cases like this, enums is probabl= y one 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 an= d stream 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 depen= dency on itself. This is what Gina's RFC seeks to rectify by breaking au= toloading out of SPL. This RFC focuses purely on function autoloading. >=20 > I see that under "Future scope" you put: >> Potentially, constants and stream wrappers can be added in a similar = fashion. > Trying to figure out if you are referring to the possibility of autolo= ading stream wrappers and constants? Is that something there's a need/de= sire for? Hey Jakob, I'm replying this in a separate thread because it is more or less 'meta'= than my other reply. There have been discussions about this off-and-on = for awhile, but the gist is that there are people that would find it use= ful. For example, in my experimental "time" library there is a SECOND an= d MINUTE constant that must be required if you have the library, even if= your code execution path never uses them. So, I think there might be so= me usefulness to constant autoloading. Further, there are some great asy= nc libraries that use stream wrappers to hijack/use file_get_contents an= d friends in an async way, so having autoloading there may also be usefu= l. That being said, I wanted to constrain the scope initially as this appea= red to be a hot topic (autoloading functions) every time it came up. Thu= s I was preparing myself for a long and drawn-out discussion and kept th= e scope minimal. I hope that helps explain why it is under future scope. =E2=80=94 Rob --8c4240e9a7c143e380441bdddb3e4abe Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Thu, Sep 5, = 2024, at 21:03, Jakob Givoni wrote:

On Wed, Sep 4, 2024 at 9:18=E2=80=AFPM Rob Landers <rob@bottled= .codes> wrote:

On Wed, Sep 4, 2024, at 17:16, Jakob Givoni= wrote:
 
2. I've removed artificial restrictions on the c= onstants in which all functions that take them can accept both at the sa= me time and behave appropriately.

I'= m not a big fan passing flags and using binary operations to combin= e options into a single parameter. 
It works, but it'= s opaque and old-school.
We have both named parameters and= enums now, can't we just use those going forward, making each option a = separate parameter or using enums with 3 cases, FUNCTION, CLASS or = BOTH? 

Thank = you for your opinion, but for cases like this, enums is probably one of = the worst choices IMHO. As mentioned towards the end of the RFC, I'd lik= e to add further support for other things, such as constants and stream = 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 dependency on = itself. This is what Gina's RFC seeks to rectify by breaking autoloading= out of SPL. This RFC focuses purely on function autoloading.
<= /div>

I see that under "Future sco= pe" you put:
Potentially, constants and stream wrappers can be = added in a similar fashion.
Trying to figure out if= you are referring to the possibility of autoloading stream wrapper= s and constants? Is that something there's a need/desire for?
<= /div>

Hey Jakob,
I'm replying this in a separate thread because it is more or= less 'meta' than my other reply. There have been discussions about this= off-and-on for awhile, but the gist is that there are people that would= find it useful. For example, in my experimental "time" library there is= a SECOND and MINUTE constant that must be required if you have the libr= ary, even if your code execution path never uses them. So, I think there= might be some usefulness to constant autoloading. Further, there are so= me great async libraries that use stream wrappers to hijack/use file_get= _contents and friends in an async way, so having autoloading there may a= lso be useful.

That being said, I wanted to= constrain the scope initially as this appeared to be a hot topic (autol= oading functions) every time it came up. Thus I was preparing myself for= a long and drawn-out discussion and kept the scope minimal.

I hope that helps explain why it is under future scope= .

=E2=80=94 Rob
--8c4240e9a7c143e380441bdddb3e4abe--