Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:125416
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 31CF61A00BD
	for <internals@lists.php.net>; Wed,  4 Sep 2024 15:17:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1725463153; bh=A+QvmseCpizNUn2sb5BPthLGas13x3nX2J7ZSxJm4yw=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
	b=DkN4wJSNZqIu88UPqxjbxoGKwhYP29tBi6PDDjsBPn0yWrNMDXLZ6z/h0b8D7B95r
	 Ldbn2AUbAfWxWQteVg3p83l/5JUqzzmVaMr+7s3DFLEg/+cpQ2g3dvzd5AuBSuHZUj
	 sSf1Hl594r6vkgNobbRbMx9nvKdlUplLG67rjoHAokLHGkKOt1Vdey6GlxJnnBlBxb
	 MFc+YNQczecnyyrqiEE0GLXBSR7IMdfejiBf6rrd2F+HXVSK3pzOBWlmsv+v5bldrZ
	 AzY22MTkWEJ43Xzld/xcwq5Y6b/cAABunspvDH88Ir+JWN7KB+FyZQwAVrPlzbP8Oo
	 PI+mEKqALTMCw==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 4DADF180032
	for <internals@lists.php.net>; Wed,  4 Sep 2024 15:19:12 +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_PASS,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: <jakob@givoni.dk>
Received: from smtp-out3.simply.com (smtp-out3.simply.com [94.231.106.210])
	(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 <internals@lists.php.net>; Wed,  4 Sep 2024 15:19:11 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by smtp.simply.com (Simply.com) with ESMTP id 4WzR1M6nvSz1FlkP
	for <internals@lists.php.net>; Wed,  4 Sep 2024 17:17:11 +0200 (CEST)
Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "smtp.gmail.com", Issuer "WR4" (verified OK))
	by smtp.simply.com (Simply.com) with ESMTPSA id 4WzR1M42NPz1FlkQ
	for <internals@lists.php.net>; Wed,  4 Sep 2024 17:17:11 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=givoni.dk;
	s=unoeuro; t=1725463031;
	bh=A+QvmseCpizNUn2sb5BPthLGas13x3nX2J7ZSxJm4yw=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=AYDSM4Z3tCcdF14jND8PGT+boCZdwtBDlK8Q5752itWka/kS1fR4zY3wVwe+4lMXn
	 Qy7M5ev4oVM3Dy+nBXdw5JX6X07ONsrXIDwaPdiWALjSRIuR9H1TNXco142u5vClf/
	 7zJYXPlDOFVfdbcljunAGpBvZn/Hqey7+feB9/Ho=
Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-6bada443ffeso7272497b3.0
        for <internals@lists.php.net>; Wed, 04 Sep 2024 08:17:11 -0700 (PDT)
X-Gm-Message-State: AOJu0YxyACndaUtJcD0wAloCE1RJskEai3zVfSgs9gtUQAikkuKItFDz
	7oKTkq+B+n75gKCUIIdXLjk6ynJsUzBhjGvbich6aMN9fl7R1ptLHWbQRcVzm6tlGI+iWw9HJTD
	THdZiSPfM9Y79097bUkhsbuL7SnE=
X-Google-Smtp-Source: AGHT+IHf7HIWmJm+EiMfNd3R9EH18D65EzmeaZpQ0y8kTThFbWnIxX/nw4PJn2xj4+q0lMJQ8y2XeGOLiCx6hy6U8is=
X-Received: by 2002:a05:690c:f84:b0:6d5:b062:4beb with SMTP id
 00721157ae682-6db25fcb383mr20076977b3.16.1725463030310; Wed, 04 Sep 2024
 08:17:10 -0700 (PDT)
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
x-ms-reactions: disallow
MIME-Version: 1.0
References: <2716f729-4008-4f75-8412-861d8960b746@app.fastmail.com> <df217c26-cb23-46d6-b931-431c8971599c@app.fastmail.com>
In-Reply-To: <df217c26-cb23-46d6-b931-431c8971599c@app.fastmail.com>
Date: Wed, 4 Sep 2024 17:16:59 +0200
X-Gmail-Original-Message-ID: <CAJmjfvX4baKOA=MgM8FntPavtnTC+dh+bbfncfP8f1OwiGQDzA@mail.gmail.com>
Message-ID: <CAJmjfvX4baKOA=MgM8FntPavtnTC+dh+bbfncfP8f1OwiGQDzA@mail.gmail.com>
Subject: Re: [PHP-DEV] function autoloading v4 RFC
To: Rob Landers <rob@bottled.codes>
Cc: internals@lists.php.net
Content-Type: multipart/alternative; boundary="000000000000feb7cb06214caa88"
From: jakob@givoni.dk (Jakob Givoni)

--000000000000feb7cb06214caa88
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 3, 2024 at 11:49=E2=80=AFPM Rob Landers <rob@bottled.codes> wro=
te:

> 1. I've removed the BC break=E2=80=94the 'type' of the autoloadee will no=
t be
> passed to the autoloader. This can allow 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 as the second parameter. Is that
intentional?


> 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
> appropriately.


I'm not a big fan passing flags and using binary operations to combine
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?

Best,
Jakob

--000000000000feb7cb06214caa88
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Sep 3, 2024 at 11:49=E2=80=AF=
PM Rob Landers &lt;rob@bottled.codes&gt; wrote:</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">1. I&#39;ve removed the BC break=E2=80=94the &#=
39;type&#39; of the autoloadee will not be passed to the autoloader. This c=
an allow someone to use spl_autoload for function autoloading if they so de=
sire.</blockquote><div><br></div><div>Unless I&#39;m missing something, the=
 main example in the RFC still shows a function which expects the $type as =
the second parameter. Is that intentional?</div><div>=C2=A0</div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s=
olid rgb(204,204,204);padding-left:1ex">2. I&#39;ve removed artificial rest=
rictions on the constants in which all functions that take them can accept =
both at the same time and behave appropriately.</blockquote><div><br></div>=
<div>I&#39;m not a big fan passing flags and using binary operations to=C2=
=A0combine options into a single parameter.=C2=A0</div><div>It works, but i=
t&#39;s opaque and old-school.</div><div>We have both named parameters and =
enums now, can&#39;t we just use those going forward, making each option a =
separate parameter or using enums with 3 cases,=C2=A0FUNCTION, CLASS or BOT=
H?=C2=A0</div><div><br></div><div>Best,</div><div>Jakob</div><div><br></div=
></div></div>

--000000000000feb7cb06214caa88--