Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130233 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 079D41A00BC for ; Tue, 3 Mar 2026 09:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772529892; bh=eOc2gapj3YgARPVtouHScpIicr0vZYNr8QYLypUJ9r8=; h=References:In-Reply-To:From:Date:Subject:To:From; b=WyMf/OjaQh4G8XYZ1XelWE0UzlIR+cbXQ92VfH0B9/z0F+AwBMMUQ8XOhCGyP/EfT vH4z9GXq9tQ83jOreSnQLBUMyV9MhJoddMXcqSBEa3H07JiF5obOzcSGaTgum/0gaE +meFwqaBP/YBey5ScWhJt/SiIL3jlskm1BDItOSZAljJzTCdUWJ+eDa3VDLVSVhjKN S2yE8DCs/hiY2Grw6nLJKLROP7CW4QmV/nSDI9nqFW1HNioh4IZQUPBnyMQ3FOQ5HR w3NYu2ldhVe3BdsRFtcPSktJ0rf9/YoJqSJo4kYMqxVNA8oSnMJ0rrue7RzXVUrlk5 /bLFxYTS8Lt6Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 853FD18005B for ; Tue, 3 Mar 2026 09:24:51 +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=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 ; Tue, 3 Mar 2026 09:24:48 +0000 (UTC) Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-45f053b7b90so3663516b6e.0 for ; Tue, 03 Mar 2026 01:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772529882; cv=none; d=google.com; s=arc-20240605; b=Mqbxb1xHtmsoaO6KILejv9Ygbd+h0pi1F41eomJNrP3ICo4qpc9SEnG42/PnQLKId1 KH5S2U9IIKij1Z/qxlKjFu2b+b7EKtDOhj3Gk8OyBeJrI4bTNkPv6C8LtQOsOrrpGnFG Zvf5Xe+xYyRBI7Ok7aU7somrAHUWrK8ZsDKKkUlUPYwcjpsLGT5764gcVA/3hBN+Lekd dFNUOhEY3NWcP8QbGKx3S7fyFcf2eDZ5ElbaurHBqAPrmxB2S/ulcbpj1t1hIx4YAUT8 4k25kcaFJZkkvuwN4JMgk+s260uHJG6Wj+bjynMGeEU2F5jRBv857FfRLbfsGPA5y40R a1AA== 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=3DU98XOI9c4VWJ2DXYmIbLhEBf5XjKvSUUBcXPD3AEM=; fh=+scO3rkxw7oRsJr1IFJSr51LZdWnuJSnXkUgLmUKltE=; b=bgk/LFN8DKiHb+O6zmq42fsx2yK0Veq/t6RdJFdOfVNYhDqpDS6sg57xF6G4TV0hZE Z7IJH8yShSuwH3EtnQjx356zKdAhyOPAtRV5aNdtTI8DCSj5Ja3PuVMIdjJnG/a1zha1 u4qUjr1o0TeHA1PoIxCxEjHtR3eZrIzc3pl+BfNWw8Am/YmHMW2+/ucGOPwVZNWyGHLV BMMYzGqeCZAtLwmgy+LFhLZTu1iv7yVaRG0JeEJve0weI3IvPjZS4IjpmFGxEArcjvy8 ihjwfo9CSYMVy73nC5e80u/p62Mr7qP6rdeI1+CobY4u6Q6SpiqgXnf0pRVf4XP3bp2T Qz2w==; 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=20230601; t=1772529882; x=1773134682; 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=3DU98XOI9c4VWJ2DXYmIbLhEBf5XjKvSUUBcXPD3AEM=; b=bYAFQjUgbnXORxf2fWqEqY7+vVkZvUC+ljVBNKKVq7qIlvxxJKLTQndRCgYV2XiO61 4wUTp5tYsaSSnXGPG0O9jEib7Y9sdsPGN7lp9o1MFvbSafhNS8HEQqfQEkWCLMT6R+rB SFlOVK2AEyDGFSjy1URjqHLl++8UanvPw1odfK2Io4CuCl0c8Q/6pVVkF+YDtfeibsT5 2weZ3Xu30pK6xGHshdTnzF3YJUNXmvS1HVcAbIoNT9xtTfpxSz9HRW8olj9MAgBGKiIe f5eqiz4eYTV7POFfCIJVSEGBIuNlOkJzpf7/LqTUVQ6IdmFF2l5vmsb1FGLR+ztpTy+G mXvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772529882; x=1773134682; 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=3DU98XOI9c4VWJ2DXYmIbLhEBf5XjKvSUUBcXPD3AEM=; b=u5r/t39ianXlJwh/Jb1JQDa01mdLbr2gmULp+oq7DtfuuoXzr6qp9Xr6ef/I/huHRC nGgYLYSrlnk98cRpGHIN6Yx082XAHWowqoutjESkthXX7Jrx7x7jMQsLbFw69OrMAnhA dJnTYPI+F/d6xfHe9I/2zbdFD9PtIhpGhrFZAZuzXX3e2Uw9vs7UbT4KmvNCufYoXQNQ UZGBHn+GunWiBkqcDcB2yM7Z08RJ5x0xBLYRuGi3aDSqRAw0DpaHlS5EvRbTUI7vW5Tw I+jac1qASrLunxUOoJruH22veTuh1GMbwfk+6EYiXnhxqG4WLq3KulbfZmgA9vwFYfoP Z7cg== X-Forwarded-Encrypted: i=1; AJvYcCUAvHe041GvX72PuGS/AfSHBCp0je9avkE60xEiujxxQMoiTfJKK7xSwi7vF7l1egHWyVZqg9VfEyQ=@lists.php.net X-Gm-Message-State: AOJu0Yz5QGhMHyx4INFZluiR6vWxiHUubmLw2F3OznZwHufdrRtq7ghi XOxbhDNAmMcc4EvKmlBOW63K5s2Sqf4XOmAbjJOj1gcfWsZJluPNQeinL0VrC41IhH6+oTSt35z zBpwpqVllxLL1SUKaGmkc6xJb5YoaqJ1tRRwE X-Gm-Gg: ATEYQzyQ8CADhaUd3b5p4ZD5my1ynJ+wTo/9UH+2+tFNpfetuSrikVu1yQRqni+TXty v68yT6PxqQwd2Ff3S/Smni/ZbNg+Ku4wBMZFZwXy7mf+R5ldMmrX9XNh/LT+/uCmT9IDqWiR5ec eAAeb9/hkuDIE6c5qBm5L9+XnHqhPpKivSgR7K7qn6mJAY07sAbyOqq6UjysYQcfN6WIQDS6uFL uYP51GmnOy5aoaaa3DJ808NOIb8iLzbFOQzNonfqjhQt7Kx/Pd7k2D6B5xJpSfdCoN3BH9iis/n hbOpY+8w X-Received: by 2002:a05:6820:4611:b0:66e:20fb:7482 with SMTP id 006d021491bc7-679fadbb01amr6809623eaf.9.1772529882415; Tue, 03 Mar 2026 01:24:42 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <83238ad3-c844-4457-dfb3-11321787e022@php.net> In-Reply-To: Date: Tue, 3 Mar 2026 10:24:31 +0100 X-Gm-Features: AaiRm51wDBMwNr8oeEXhxObA7c5-g1YqI70Mhidr7DXIpnVezYLwcfztBf4oXwE 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="000000000000fec701064c1b4599" From: nyamsprod@gmail.com (ignace nyamagana butera) --000000000000fec701064c1b4599 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi M=C3=A1t=C3=A9, I just re-read the RFC and I like the updates and precision you've brought to it here's my review: For the builders I have nothing more design wise to add this is already solid. I may nitpick on the *Builder::clear() method name I would have gone with *Builder::reset() but I presume other developers would go with clear. Other than that the public API is spot on. For the Enum, my only concern is that they serve just as flags and their usage is tightly coupled to the Uri classes. I would add 2 static named constructors fromUrl and tryFromUrl just for completeness. I believe the maintenance cost is negligible but the developer DX is improved and allows for a broader usage of the Enum. In regards to the path segments usage and constructor I see you already integrate my Enum suggestions and you have explained why a fully fledged class is not the right approach. So the current design is already solid. Last but not least, The Percent encoding feature should be IMHO improved by moving the encode/decode methods from being static methods on the URI classes to becoming public API on the Enum. This would indeed imply renaming the enum from Uri\Rfc3986\UriPercentEncodingMode to Uri\Rfc3986\UriPercentEncoder with two methods encode/decode. Again it makes for a more self-contained feature and adds to the DX. Developer will not have to always statically call the URI classes for encoding/decoding strings as the Enums and their cases already convey the information correctly. Overall I believe this is going into the right direction Regards, Ignace On Sun, Mar 1, 2026 at 11:09=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis wrote: > Hey Ignace et al, > > I have updated the RFC in the past few weeks with a lot of extra info, > mostly related to path segment handling: I investigated WHATWG URL's > behavior more thoroughly, and it turned out that path segments are handle= d > very interestingly, so there was a significant difference compared > to RFC 3986 yet again. > > Please give the RFC another read, if possible. > > Regards, > M=C3=A1t=C3=A9 > > --000000000000fec701064c1b4599 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi M=C3=A1t=C3=A9,

I just re-read the R= FC and I like the updates and precision you've brought to it here's= my review:
For the builders I have nothing more design wise to a= dd this is already solid. I may nitpick on the *Builder::clear() method nam= e I would have gone with *Builder::reset() but I presume other developers w= ould go with clear. Other than that the public API is spot on.
For the Enum, my only concern is that they serve just as flags= and their usage is tightly=C2=A0coupled to the Uri classes. I would add=C2= =A02 static=C2=A0named constructors fromUrl and tryFromUrl just for complet= eness. I believe the maintenance cost is negligible=C2=A0but the developer = DX is improved and allows for a broader usage of the Enum.

In regards to the path segments usage and constructor I see you al= ready integrate my Enum suggestions and you have explained why=C2=A0a fully= fledged=C2=A0class is not the right approach. So the current design is alr= eady solid.

Last=C2=A0but not=C2=A0least, The Perc= ent encoding feature should be IMHO improved by moving the encode/decode me= thods from being static methods on the URI classes to becoming public API o= n the Enum. This would indeed imply renaming the enum from=C2=A0 Uri\Rfc398= 6\UriPercentEncodingMode to Uri\Rfc3986\UriPercentEncoder with two methods = encode/decode. Again it makes for a more self-contained feature and adds to= the DX. Developer will not have to always statically call the URI classes = for encoding/decoding strings as the Enums and their cases already convey t= he information correctly.

Overall I believe this i= s going into the right direction=C2=A0

Regards,
Ignace


On Sun, Mar 1, 202= 6 at 11:09=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis <kocsismate90@gmail.com> wrote:
Hey = Ignace et al,

I have updated the RFC in the past few wee= ks with a lot of extra info, mostly related to path segment handling: I inv= estigated WHATWG URL's
behavior more thoroughly, and it turne= d out that path segments are handled very interestingly, so there was a sig= nificant difference compared
to RFC 3986 yet again.
Please give the RFC another read, if possible.

Regards,
M=C3=A1t=C3=A9

--000000000000fec701064c1b4599--