Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130735 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 lists.php.net (Postfix) with ESMTPS id 12B261A00BC for ; Fri, 1 May 2026 13:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1777643875; bh=OCB1hh0yWiEP/CV3HRY5nv667L+uokuW+4bhz1ptWd8=; h=References:In-Reply-To:From:Date:Subject:To:From; b=b8r4FBBtzI25UstFY5Y9O6Lx/NxVULke7GvYpl30Y/d0mhBNeODN/+xbMPvJ9hKAr 0Dwrw2rOx5uANbI3v60vrRi8HooDXVocS0YDIE6UTNZnYeBPYJ4rQCmFiV/pMfZrM7 gegMgMQq0mcmqCGEbHpYnV5xSCzpZmctVqrK+HyN9Xbm81IwU3XgQG+J+/Oo3gAz35 etqiZsr3N/WQJxjeebpBipac7R7p6Hz9OvitSCkuSJYdVuHOQ0IHVU5LqkbWq/5WAO EzW9v4S5WSeRpK55WjfKEvMlrdoKIlKumiSCRqOf89YeqbF0Kh+S5B3d0Ra3djbeJ0 nuOHyqzmmlyMg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6660F18005D for ; Fri, 1 May 2026 13:57:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FORGED_GMAIL_RCVD, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 ; Fri, 1 May 2026 13:57:53 +0000 (UTC) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-7dea20cf21aso1902576a34.1 for ; Fri, 01 May 2026 06:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777643868; cv=none; d=google.com; s=arc-20240605; b=c3zu4LxcUqO49SCUxZ/9WK3pgPHAqmdwTN6IpK6MtuoKUnJ66uIGLaObbgt/2wtQDd vuNaezzLCos6Xqy86rkAEGPUXxaVgmqlnfIVh99DgTzqxUnyLsZVrn3bx6Uiudd7+wIS brLgBHPY8EZjbJJHQ98ZPMT5wQNvYLfetwavqpAarj8JHuDSIezSKZ2ohULK+YE3aqSu hw/rF6avfQXw0ksBkEv5qeNyJRc6CxwbmnMOxcCtLcsgsBqkig8hc3zq7ahNhW8twHxr 4zBav0LQzGNvYBeb51Tkx8yIiEndL632QAIMz5mSbIu0FKZqqSovNBx6quTCw/GvNjaG 6enA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0eZTN3ciHNRJpWvf8wJszkZl9HZSG2xuVKsY/VeRR+o=; fh=G5UrtU6+MMNatSDtrS6vxytlFAyGKLBG+8gKyGe+/OI=; b=PZcdo4Vz1vw0/Y7jJoy9lqTy1sNjN6TM/WMOUU1kzXS4SWAx9fmjyCL2GLsNNR0jsh m0BbgI/NMmPJK4DglGOAx8U4ZiYwUgn2/lZud1DkMFJAQrfzHt3gZZaq7lR0fE78VNAE YJ+AuWOAgpt5KS3fwzMrhOtXcQnKQZbNayN+CCWfwhfo0kDbTPxqApRngxv6+vjgM8bd drojh76hBCQ++VHhZdYtwUOL/rl6stmIEYJmu6+c790iR5cydKbH+nR6BmQEBLmvS32v ipjq0RZPeMkBtwJ5h6Rfs0EZ2wcvPeSdS8XdrNfheYMGik/OWfnv8E1z5k8mpTKykclo Qhkw==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777643868; x=1778248668; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=0eZTN3ciHNRJpWvf8wJszkZl9HZSG2xuVKsY/VeRR+o=; b=k61tbSfc1kQFtI9ryMTvIk5ztTM8toRC4ldkJytmp9tBYgoNCzZYBUYkGWeZv3EFTX l4eAp4ZPmuOWm7INXrpwOEudEzcUPODk2w8yCMkqYz1SnjYPMFKfqlt7a9YlI/S5nHmJ ZABVoxcK38KnQBGmbhK1TdXmo0evS7rC7tZkMhaBfPU3JHsfgkY8DeysjvOBOIiEk0rk HvJJs8OgSY3D87pZorkeojwSRr7LviRlqPSg59U2tNmIZOtYlGR27rOrNj1BQEZQ11cF 8v0MFAkWv+R1QqPjRGZOUj7UjlydNEFlY3aOjI1hogYDpvhdXblc6+hz+BkUGcZ5pGgb zAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777643868; x=1778248668; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0eZTN3ciHNRJpWvf8wJszkZl9HZSG2xuVKsY/VeRR+o=; b=XjFei+GSGiLkJhpPiIUKsrcGs1ZD5EpWLEAgroW4PD4AP2acaGDVpHtlI+fqCb8+de zaoZpDe59iTKTcbV5M/4L6Sqg8oj1cSNJEUmmLIzTbkJlAOxLALyRsY7/F4GLTAbyIV1 urFGD5TTlVJtJ/ZhIeQG4QMiVAb2d5fKHvDHHCj/w7sxVMG8P/BmiP8Q3BpAs/TeJaPK g2A+vV/5LPHvDupc53E7yPvgo+XWWLca4xxARm1ZcMANDQaHUAlLnro26CSnI5FkBkYS NxUZy2MCvuqb28eD+NOpyjkiTwDbx9D4jE7z1h6bLX1bsYFXj+bbhVAuZ9WA1TiVDR2n JBqg== X-Forwarded-Encrypted: i=1; AFNElJ9vhyV3neC2x4F5Gxx/OkYBX4fb+B/O3JLCzlpfq0K0vsaPWTU05wKsgFG10XHKGP05my5wJGb07EM=@lists.php.net X-Gm-Message-State: AOJu0Yxruh0q5oTVId2FXa7fc8P4xh2LSur2m2Pbog8685PpH688UU13 61IlpcBNz6T2CYkROdGotEPdCRTir7idt18X+Vm8+3xOQzKitpQW7Xyvm7yRA/oH73spJgDlAUx ALLkryXQj7ETc6bYi98aI99ndlSD9chQ= X-Gm-Gg: AeBDieuPkLydPg+/608JJqFZkzlKyL/a5jk263q2r/2Ef9lyc8eDI78VmO470JZyru0 3aN5y00ZcBIRy0lFd2Fj+5GyB82FFj+LUAJonNDGdFH/4TxJW65FW7+GgLebuX7EAbZd9eyEsfk OAyY5bRaufNwzjRnaPQs9KqTg5n/vE5Xm6wLxikp9O86YVHAjiU3FcHrGnd9r5Q9PYJujkc+1ds WUNnbraiEVMXT8DRj68KqjYfTt25F4+MnSHbbx2b+WaHM6GREVdO8d0+opq/KhgidFPhsgkKtes arfZjHBEI7OPw/AFTuQ9DOCwID386jk4TvkRbHG9Na+Zw8+J8A/+ X-Received: by 2002:a4a:e90a:0:b0:685:2a2d:ccb3 with SMTP id 006d021491bc7-6967a4dd362mr3838444eaf.20.1777643868204; Fri, 01 May 2026 06:57:48 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <1fee2f46-27b7-4eb2-908f-b38f8c78d8c9@bastelstu.be> In-Reply-To: Date: Fri, 1 May 2026 15:57:37 +0200 X-Gm-Features: AVHnY4KJAIVHtVLfrm2S7KXBroCb5v5918kIEdZNOK8fY7JuelbQPmB6-cMGgOQ Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Followup Improvements for ext/uri To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000004d32090650c1f777" From: nyamsprod@gmail.com (ignace nyamagana butera) --0000000000004d32090650c1f777 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi M=C3=A1t=C3=A9 and all, I have no issue with the usage of namespaced functions, on the contrary I think that they do give a better understanding of the intended API usage. It is a self contained feature which is fully decoupled from the main URI classes with 0 side-effects. My main goal has always been to provide a better UX over having static methods on the main URI classes. As you pointed out, adding percent-decoding in a later stage seems reasonable to me, if we can find a way in the meantime to remove the mis-usage or mis-understanding you highlighted then at that point adding a new function will then be a no-brainer. So there will be no pushed back from my part around this change. In the meantime, I have already updated my polyfill to be inline with your last changes. As I said earlier, the fact that the introduced Enums can not be instantiated from an URI makes their presence in the polyfill required but incomplete as they can not be used before PHP8.6 since the URI classes are final and no named constructors can be attached to them to allow their instantiation from an actual URI instance. see https://github.com/thephpleague/uri-src/pull/170/changes Looking forward to your call for voting and its outcome. Regards, Ignace On Thu, Apr 30, 2026 at 9:19=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis wrote: > Hi Ignace, Tim et al., > > I've finished updating the RFC once again, after some private discussion > with Tim: > > It turned out that the percent-decoding feature as proposed would have le= d > to confusing behavior > in some cases. In order to avoid this, I ultimately removed the > percent-decoding support from the > proposal. In the same time, I pivoted from the "instance methods on an > enum=E2=80=9D based approach > to a simple namespaced function based solution, because the enums would > only ever have a single > method (even if decoding support is added later, possibly not all the > (Uri|Url)PercentEncoder enum cases > would be applicable for decoding). Let me know if this doesn't work for > you, TBH adding namespaced > functions was my least favorite solution, but I didn't have any > significantly better idea which would have had > the potential to gain traction. > > I have called out one example in the RFC ( > https://wiki.php.net/rfc/uri_followup#percent-encoding_support) which > would be problematic if we had a Uri\Rfc3986\uri_percent_decode() > function, so let me copy-paste it here for reference: > > $uri =3D new Uri\Rfc3986\Uri("https://example.com/?a=3Db%26c"); // The q= uery > is the percent-encoded form of "a=3Db&c=3Dd" > > echo Uri\Rfc3986\uri_percent_decode( > $uri->getQuery(), > Uri\Rfc3986\UriPercentEncodingMode::Query > ); > // a=3Db&c > > The result is probably not what we expected, because percent-decoding > changed the meaning of the query component: > - Originally, the query contained a parameter =E2=80=9Ca=E2=80=9D with va= lue =E2=80=9Cb%26c=E2=80=9D > (=E2=80=9Cb&c=E2=80=9D) > - Now, there is a parameter =E2=80=9Ca=E2=80=9D with value =E2=80=9Cb=E2= =80=9D, as well as a parameter =E2=80=9Cc=E2=80=9D > without value > > And I'm now attempting once again to announce my intention to start the > vote: > If no significant issue comes up this time, then I'll start the vote next > Tuesday evening (according to UTC). > > Regards, > M=C3=A1t=C3=A9 > > --0000000000004d32090650c1f777 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi M=C3=A1t=C3=A9 and all,

I have no is= sue with the usage of namespaced functions, on the=C2=A0contrary I think th= at they do give=C2=A0a better understanding of the=C2=A0intended API usage.=
It is a self contained feature which is fully decoupled from the= main URI classes with 0 side-effects.

My main goa= l has=C2=A0always been to provide a better UX over having static methods on= the main URI classes.=C2=A0

As you pointed out, a= dding percent-decoding in a later stage seems reasonable to me, if we can f= ind a way in the meantime to remove the mis-usage
or mis-understa= nding you highlighted then at that point adding a new function=C2=A0will th= en be a no-brainer. So there will be no pushed back from my part around
this change.

In the meantime, I have alread= y updated my polyfill to be inline with your last changes. As I said earlie= r, the fact that the introduced Enums can not be instantiated
fro= m an URI makes their presence in the polyfill required but incomplete as th= ey can not be used before PHP8.6 since the URI classes are final and no nam= ed
constructors can be attached to them to allow their instantiat= ion from an actual URI instance.=C2=A0

see=C2=A0https://= github.com/thephpleague/uri-src/pull/170/changes

Looking forward to your call for voting and its outcome.

<= /div>
Regards,
Ignace

On Thu, Apr = 30, 2026 at 9:19=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis <kocsismate90@gmail.com> wrote:
Hi Ignace, Tim et al.,

I've finished updating the = RFC once again, after some private discussion with Tim:

It turned out that the percent-decoding feature as proposed would hav= e led to confusing behavior
in some cases. In order to avoid this= , I ultimately removed the percent-decoding support from the
prop= osal. In the same time, I pivoted from the "instance methods on an enu= m=E2=80=9D based approach
to a simple namespaced function based s= olution, because the enums would only ever have a single
method (= even if decoding support is added later, possibly not all the (Uri|Url)Perc= entEncoder enum cases
would be applicable for decoding). Let me k= now if this doesn't work for you, TBH adding namespaced
funct= ions was my least favorite solution, but I didn't have any significantl= y better idea which would have had
the potential to gain traction= .


$uri =3D new Uri\Rfc3986\Uri("https://example.com/?a=3Db%26c&quo= t;); =C2=A0// The query is the percent-encoded form of "a=3Db&c=3D= d"

echo Uri\Rfc3986\uri_percent_decode(
=C2=A0 =C2=A0 $uri-&= gt;getQuery(),
=C2=A0 =C2=A0 Uri\Rfc3986\UriPercentEncodingMode::Query);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// a=3Db&c

The result is probably not what we expected, becaus= e percent-decoding changed the meaning of the query component:
- Origina= lly, the query contained a parameter =E2=80=9Ca=E2=80=9D with value =E2=80= =9Cb%26c=E2=80=9D (=E2=80=9Cb&c=E2=80=9D)
- Now, there is a paramete= r =E2=80=9Ca=E2=80=9D with value =E2=80=9Cb=E2=80=9D, as well as a paramete= r =E2=80=9Cc=E2=80=9D without value

And I'm no= w attempting once again to announce=C2=A0my intention=C2=A0to start the vot= e:
If no significant issue comes up this time, then I'll star= t the vote next Tuesday evening (according to UTC).

Regards,
M=C3=A1t=C3=A9

--0000000000004d32090650c1f777--