Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127232 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 478DD1A00BC for ; Mon, 28 Apr 2025 21:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745875133; bh=PFevN+fc4SaYL416XGS+mEW7+IV33XLFzRFoXrm4gPs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iGrXV2DtkW+WaFtd2+7lvbVKRU2BivR4izm/PhAJ80zmEF6/QqPA0kTjzbTw6wQyn pr6j9UYz8sv5wywmhSBFM58lBvFFx4pMjBvzjSj5A/lbtFft3+94qYaL70Z2UMqjUi Tj286UKQwwgvq3NIbbRTphO2hJpd6Y9FDN3f/XdNAsDTdvklCVkmlWm9RaeGnKlREh NYdUSGE9rq7nIvk36CETcSz8kPW6TF6t8uyPRJCg8LT6wNo+L3XVm+zxVL8nnYs8Ux /vjytnUhs+bNmAXbeZzTrx3gznContb3PESW/7e5MpXfnLiX6pxQOUK1zl5ojigdR4 vqtPULJS51Epg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C4879180568 for ; Mon, 28 Apr 2025 21:18:52 +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.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 21:18:52 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-47690a4ec97so63104151cf.2 for ; Mon, 28 Apr 2025 14:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745875269; x=1746480069; 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=PFevN+fc4SaYL416XGS+mEW7+IV33XLFzRFoXrm4gPs=; b=b2W9ngdtJr2FzgXEiqzkxIcK8ShQyPmt17j3ponfVYNQ/wG9hJuOdJGKYy/66C4VG6 DCfJppqj4eUi7wPeOYr09n83xyk1EHi+PccLLKHwWrNmz+gAj8zNMR8WfsOuqKB16Vr/ UsDAIEMpOjD7tQJFrsBfy/FELAWR18KXe1FI10f+LF8uKB4sg7JO5EmIKPleqxhI5RX5 Lo0FN8UHxShmfdM2rUtqHWPAtW72mZO7j3LoeU0ZOc/fUW3RMHjT29E3SOb30D9lPDhw wtGsFWWe3Z5UxNLBSsKyxMGJb1CTvosKD0iUt2DoZLM9fSFBNVu91UyXKVw07we1tezw I9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745875269; x=1746480069; 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=PFevN+fc4SaYL416XGS+mEW7+IV33XLFzRFoXrm4gPs=; b=LYmJDmxDNPbfkO1gpjRBq9oyYRZ93MCXpDSHEEF94QoibOEX4xqqGY0rSzolJxDOeB R4mLNoy04xSjx5GEnX1ss3YkXy+8Oe3PxyIL+v74N5l58jrxyRBJYofYxZ/x/x/VwtpP +r138rRC/cn5HvaYIb3djgs0x3LD1c8rEdpW977zscAabp6a4+ibQ88ExfKG75x5DGdf 4J2BF1o4PAYfaSmMSxES6Cd+Eo/YXewKFL1lOg9n+JLKtVd+dqY6JkEESo9h/5aaFicC 2H0iCCmrnCSumSf3lKES80hXh2fd0an2qojDrmiAns07T4KYDBmu0CjrVPTPqm40LF5K Tgeg== X-Forwarded-Encrypted: i=1; AJvYcCX0M5EqGgWx5TdnaX3OT+Zp3jl5L7GHA0oWogj85exx5Jxe9wP7ndISjstsje22RtEPdfOpVEqojDY=@lists.php.net X-Gm-Message-State: AOJu0YzcRf3yCIOIPz/4BHquqyqdz44qThy4ZRYj7yP3w6Fx/xdBXuWW SGNUh17vaT5CGqhDLO2OuU/WEq/TuqTrmuSjVWGGzPZAQb8hDtCcqLY1LHyVo2aZgNtw9+NxWAY 9WvMuVV8z28fLba2GehGENQLPqHo= X-Gm-Gg: ASbGncvpatU//mNHiL4OsD1OIhTQughHzyiaJ/jsdvBykM4zuXnhSlpX1Z9ymo9JPBE ewzVQ0mezeJsgWXaBo+pqijsCXu6qcx2skIvOOxwtB5ruRMACYT13ZzJbiPdpcq/Y+Q0YHZb7Ga fALgK+T7xL+l97BjIIbJDNpR08szOEbwUw X-Google-Smtp-Source: AGHT+IEdyzA09SGFqgRPSY+iuaP9GzViSdYFJ6IybFQBvc07b2VNM00+r+NQbZh8uNzvIC9qTzbEsRbif6ABZ/Xuc8w= X-Received: by 2002:a05:622a:4c15:b0:476:977c:2eb0 with SMTP id d75a77b69052e-48866410583mr12824561cf.30.1745875268761; Mon, 28 Apr 2025 14:21:08 -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 23:20:57 +0200 X-Gm-Features: ATxdqUGDG3WFbGLQhQl0cTyz71NOilLqw60xzJ063WKILLUhsa7x_mihilBUz-k Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: ignace nyamagana butera Cc: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , Internals Content-Type: multipart/alternative; boundary="000000000000377da80633dd4340" From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000377da80633dd4340 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ignace, 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. > You are right, I completely messed up the value of the $excludeFragment variables in the examples. After having thought about your suggestion, I'm fine with adding the enum. It's a bit verbose indeed, but at least it properly conveys the meaning of the parameter, so hopefully it will reduce the number of WTFs when people start to use the new API. :) I fiddled a little bit with the implementation, and I went with the Uri\UriComparisonMode enum name at last. I hope that it is OK on your side. Regards, M=C3=A1t=C3=A9 --000000000000377da80633dd4340 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ignace,

The $excludeFragment is `true` by default so= in the example it should be `false` instead. Perhaps using an Enum instead= would make the DX=C2=A0easier=C2=A0than using a boolean ?
I believe th= e same issue is in all examples regarding the use of that parameter.
<= /div>

You are=C2=A0right, I completely mess= ed up the value of the $excludeFragment variables in the examples. After ha= ving thought=C2=A0about your suggestion, I'm fine with adding the enum.=
It's a bit verbose indeed, but at least it properly conveys = the meaning of the parameter, so hopefully it will reduce the number of WTF= s when people start to use the new API. :)

I fiddl= ed a little bit with the implementation, and I went with the Uri\UriCompari= sonMode enum name at last. I hope that it=C2=A0is OK on=C2=A0your side.

Regards,
M=C3=A1t=C3=A9
--000000000000377da80633dd4340--