Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127219 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 7DE121A00BC for ; Mon, 28 Apr 2025 08:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745829619; bh=botL8w/DD0IjPAX62SbxLTYDW9ERhRX+isKlgA3ft+w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dXhhPpsviOZiEbUHJhE8G4X8UCLBQLYibipOaxcJ5O1S/0kHxosx1cFcW53G8uiLX B9ax5ZFrxEnhNrjfz7wn00gueu2wkBIlvJkGryJskHxLzgJoAx1qoIuo8tgfzX/8A+ HE/8ZVGJmwdByxA2+zzDmghrvExxPnL7Q10U1KXHxbR+SQb9BLkz3i9Q0C8Dm1z5LR wfi6+3BhY6OteRFltS0VWvrEwmS/PWTl7nqr/l5P83YzX4nOh0mCZCgFtgt1LQZx8c 3wG/NJcV4yMzhgOVsHB00UlZOA/YuFpcGUBSVsUha11QBSWX/TFji93JvIPhwMj6nT dtcn2LLgBRJtw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2BEC4180047 for ; Mon, 28 Apr 2025 08:40:19 +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.6 required=5.0 tests=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.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 ; Mon, 28 Apr 2025 08:40:18 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-af6a315b491so4391926a12.1 for ; Mon, 28 Apr 2025 01:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745829755; x=1746434555; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AluMU1dsINFBMBlmm/HZDLEKSkqabNdWKC3oSt068D0=; b=hZoM736TGXZjem24oq082DwAp0zAeM6B/4iYycNxgR9+wKZySQK3tSY5TFJDxjE3pc DNLJKTXD9v6Zbv7GCSlRuTvjD//irc5xtdyLRXN00cbcJs9fukqjnUuLbh1G5I4yD1tD PPDvXT5vyVCjl1JeG79wB0o3hM5EjOsjNipMu0595AZIbbUK/mrrkYURrX+cpapW3olg TqxbiBvOakLemjVmf1pdon9yqK2Cl2JIluqShhtDoOnUa/yJKJkPlLKVav3II3i6ToXJ 1XF/ej4nVVnuhxSzp9V8JxF1zbMeAW1kFeE1PSK/Dum5oYsN0vj2d5aayhsSUAAAJMMe Qobw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745829755; x=1746434555; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AluMU1dsINFBMBlmm/HZDLEKSkqabNdWKC3oSt068D0=; b=C1iOnA5wTOk/8pCnrY317A1rvs3rSEzmYcg8yqCJbX9kjenk6kpfTImwFgNwyM3dDr drvRC3kdBkQplWIOyVbCc3noBfYHKul7Y90d/BxQLIhUgmZ6fexX6XcTkzI+/TWGaJ8m IGOrL81DQIFt/xXyGeg5YJnK9APOZMbM5XXcqgoFG5xqV/3fEk5MLBR4jNheKaRqfjY5 66v/w3TXkL5nKJAy2EGLEts1NqBvQ4QYSia1l5LtF9qpYP6SYVf9cTUbmg7sDBMOXoQB 9CEwVdondL5iZDgI9tyPauoW8EZTWJj6RPH9XBBX7znUAOoEjJybM1OY6lCLEgQ4Wqs1 GCZQ== X-Forwarded-Encrypted: i=1; AJvYcCVOsFK5YbBtvSAY4ESItQKBdvy+Ehvh3VJRQM2J0vPGyaObpteAn5em06yFVIvmAviYx6BdujvJ3CA=@lists.php.net X-Gm-Message-State: AOJu0Yw1bzszrYrfIyH3T6YC5XAksDPV8i385FncYDd6Z5YQEhI+pwew dX+DE9Nu0neyMjpFzfJCMPlBc4H6m6vnY9IGTVMKltvDx7UWIqSpUPJ7ocnFYJr89xNco93HVfG LbT7bO6w4hDEWw93RLn50fnBykSY= X-Gm-Gg: ASbGncuh5PQsN5yP3xuTtrhMG24oUOwzhKPW5D6mB/wYr5wIadnAJoLfE5JKHR5E2Ky VCts6i45z/Tz8ir7XpYpKx+fDDPAJ1he/ZAicMs8Z/CKG5aMzZ0wRvvXtXE634CirwE/2Da+p8u /rRU7SfuoAKxYQ+icoyr+9jcayy61GHk5rM6gPlcVvZbrRSgUmEtK21w== X-Google-Smtp-Source: AGHT+IFYq0qpwKM2bnoR76qKCX0h7DRbakaIDcfkLRIk282lshHzT4kpmuse0qjk6YKaZrqGzAWQynbdidnIBA2HXU0= X-Received: by 2002:a05:6a20:c892:b0:1f5:5614:18d3 with SMTP id adf61e73a8af0-2046a3ed57emr11377320637.8.1745829755232; Mon, 28 Apr 2025 01:42:35 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1BCB4144-231D-45EA-A914-98EE8F0F503A@automattic.com> <8E614C9C-BA85-45D8-9A4E-A30D69981C5D@automattic.com> <8df04e01-deac-404b-beb7-cd982423db63@bastelstu.be> <33427cd03035ef084245c44290b56a55@bastelstu.be> <0aa1eefc3941bdea0092e935074daa58@bastelstu.be> <76d96ea8a78c6025128c0a4b01c94c0a@bastelstu.be> <07a8a580-4f0c-4b2f-8a67-b91dacfe99bf@bastelstu.be> In-Reply-To: Date: Mon, 28 Apr 2025 10:42:23 +0200 X-Gm-Features: ATxdqUGPDXkGCtTfAfSJA3vkXEobqVg9wyGEYP1JoMUiPTmqNi9SiqWFvinXlkY Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , Internals Content-Type: multipart/alternative; boundary="0000000000006626850633d2aaa7" From: nyamsprod@gmail.com (ignace nyamagana butera) --0000000000006626850633d2aaa7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 28, 2025 at 9:05=E2=80=AFAM ignace nyamagana butera wrote: > Hi Mat=C3=A9, > > I found another typo in the RFC examples due to the use of boolean as > parameters > > // The fragment component of Uri\WhatWg\Url can also be taken into accoun= t$url =3D new Uri\WhatWg\Url("https://example.com#foo");$url->equals(new Ur= i\WhatWg\Url("https://example.com"), true); // false > > The $excludeFragment is `true` by default so in the example it should be > `false` instead. Perhaps using an Enum instead would make the > DX easier than using a boolean ? > I believe the same issue is in all examples regarding the use of that > parameter. > > Best regards, > Ignace Nyamagana Butera > > > On Mon, Apr 28, 2025 at 12:35=E2=80=AFAM Tim D=C3=BCsterhus wrote: > >> Hi >> >> On 4/27/25 23:47, M=C3=A1t=C3=A9 Kocsis wrote: >> > [=E2=80=A6] >> >> Thank you. I have just given the RFC another full read (the 2025/04/27 >> 21:44 version) and I do not have any further remarks. I'm happy with >> everything that is said in the RFC and I'm really looking forward to >> vote =E2=80=9CYes=E2=80=9D :-) >> >> Best regards >> Tim D=C3=BCsterhus >> > Hi I would propose to use the following Enum in the Uri namespace enum UriComparison { case IncludeFragment; case ExcludeFragment; } It is a bit verbose for less error prone and by default the equals method on both class would use `UriComparison::ExcludeFragment` PS: naming can change as long as the enum reduces the errors. --0000000000006626850633d2aaa7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Apr 28, 202= 5 at 9:05=E2=80=AFAM ignace nyamagana butera <nyamsprod@gmail.com> wrote:
Hi Mat= =C3=A9,

I found another ty= po in the RFC examples due to the use of boolean as parameters=C2=A0
// The fragment component of Uri\Wh=
atWg\Url can also be taken into account
$url =3D new Uri\WhatWg\Url("https://example.com#foo");
$url->equals(new Uri\What=
Wg\Url("https://example.com"), true); // false
The $excludeFragment is `t= rue` by default so in the example it should be `false` instead. Perhaps usi= ng an Enum instead would make the DX=C2=A0easier=C2=A0than using a boolean = ?
I believe the same issue is in all examples regarding the use of that= parameter.

Best regards,
Ignace Nyamagana= Butera


On Mon, Apr 28, 2025 at 12:35=E2=80=AFAM Tim D=C3= =BCsterhus <tim@ba= stelstu.be> wrote:
Hi

On 4/27/25 23:47, M=C3=A1t=C3=A9 Kocsis wrote:
> [=E2=80=A6]

Thank you. I have just given the RFC another full read (the 2025/04/27
21:44 version) and I do not have any further remarks. I'm happy with everything that is said in the RFC and I'm really looking forward to vote =E2=80=9CYes=E2=80=9D :-)

Best regards
Tim D=C3=BCsterhus

Hi I would propose to use the following Enum in the = Uri namespace

=C2=A0enum UriComparison {
    case IncludeFragment;
case ExcludeFragment;
}
It is a bit verbose for less error prone and by default =
the equals method on both class would use `UriComparison::ExcludeFragment` =
PS: naming can change as long
as the enum reduces the errors.
--0000000000006626850633d2aaa7--