Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126521 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 264751A00BC for ; Thu, 27 Feb 2025 23:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1740697191; bh=NKUI4O6XTo50yAphBmPy9waSKqIoN/Lz/km6KWAGM9Y=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=VhS9y7CcTQDPfvb9fNSOqp42VyEW7qK0x2yrXwsfAd1guUpsqIXt4Z7TeyeFoVyKd Fm7e82tRswIE+Xcc9vT1Lp38bnrdB7M5zKLmp3epdZZuiKEy7BCgjt3njIBvS4W6ym KUGTPUIpIJX7/m44AgaLzSFQI9IqeC+JZC7f4T9NHZ39elF5OiUWwpl7etjGFZZEjf ad7hhMuiWb8w0EvxqV7mHqkvh1HEdGvsbn77Fei0qmC6/ugnN86r+bSA1rBdo8XHjo qVY2igJfUMIDsD90YFjCQDhs/B02Cq6e4u+JSxKarexLtQP0DyylOZxe3/X7PTG6wq Mn1GWlcipuDsA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F1A1A18004A for ; Thu, 27 Feb 2025 22:59:49 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,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: Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (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 ; Thu, 27 Feb 2025 22:59:49 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id A76E91140198; Thu, 27 Feb 2025 18:02:26 -0500 (EST) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-12.internal (MEProxy); Thu, 27 Feb 2025 18:02:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1740697346; x= 1740783746; bh=NKUI4O6XTo50yAphBmPy9waSKqIoN/Lz/km6KWAGM9Y=; b=q E86DPQ16IY+GB4Gzk0DdA4GqLp7Oiw7Pa0OuAsZxKaYalAyFKU0kMTrYNPZJXd25 W5VJt0bruAhAfN0V2tAzf9rw8at0T7/Uo6gHmGH/fyWuVAzDQFKlw5cv5TyZzQ1C sJAFLdEmI0g3RVZ/++Yl1utJlB4RCkJKNRU916qvMGvkQ+SSJ2NSCULUlAxZ9SbM 7MizdpfMZ/9FUXI5AnFLjeXPwIvndT0dNKBLL8XXB1KuSp5dKsdC5psGfqp50bUh aikVovr3LKyd9XNGxftyYViZ5rR1fOSBNoP4nRVhkhgY0ZEWFPS+BxUagZz1dfAd A9Vz9nZBnSxyBgosEsV5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1740697346; x=1740783746; bh=NKUI4O6XTo50yAphBmPy9waSKqIoN/Lz/km 6KWAGM9Y=; b=3eqqaDcaI8PH/bE+G1Wsr/SacK+NIGPEhCFcrQ7esDK3co5uDVI Lph4JFfUEnqEi6B8Sa2OE5rZhNpBndDFImia46AwMHF7wKM976nO5ZW15TaBhgQ2 f/cGtDItBQOgxnqqpWNQpIpPW7Y3mGDHeLUoMSsf9x0RgOjrvh9EyUbYPx+omi6l lvLUbEiRVcFjV1rezVf3hbu8lcCGOS3sXdFGDk5v9cRe3gPiq82eue4mnv7HT3/x 5GgT7oHr6FdG3OpzGZ1QFd/qbj+4r3hjlD9f7VBxxFapcnHOtirf5BcdjQxqU5cG dkOHDcfX7pWezlC+H1qwUS7paUJfn9cCieg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekkeejgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvvefkjghfufgtsegrtderreertdej necuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtg houggvsheqnecuggftrfgrthhtvghrnhepieeuteehvddvfeejhffgieehleehhedthfef keejffelgfevvdekudetjeejtddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghp thhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhimhessggrshhtvg hlshhtuhdrsggvpdhrtghpthhtohephhgvlhhlohesfhgrihiirghnrghkrhgrmhdrmhgv pdhrtghpthhtohepnhihrghmshhprhhougesghhmrghilhdrtghomhdprhgtphhtthhope hinhhtvghrnhgrlhhssehgphgsrdhmohgvpdhrtghpthhtohepihhnthgvrhhnrghlshes lhhishhtshdrphhhphdrnhgvthdprhgtphhtthhopehpmhhjohhnvghssehpmhhjohhnvg hsrdhioh X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 98CB3780068; Thu, 27 Feb 2025 18:02:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 28 Feb 2025 00:02:05 +0100 To: "Faizan Akram Dar" , "Paul M. Jones" Cc: "ignace nyamagana butera" , =?UTF-8?Q?Tim_D=C3=BCsterhus?= , "Gina P. Banyard" , "PHP Internals List" Message-ID: <93898e96-bbd6-4c2e-a1ad-35499bb2510d@app.fastmail.com> In-Reply-To: References: <811B65CE-1DF0-4A47-937C-4FCB6E945B92@pmjones.io> <19377F60-FB7F-4E6E-A085-4DCB6CD92234@pmjones.io> <7B7987C6-37F3-432A-8BA2-9D93F428FAD5@pmjones.io> Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API Content-Type: multipart/alternative; boundary=15b8458da7fb44a685d8aca4be01c2a8 From: rob@bottled.codes ("Rob Landers") --15b8458da7fb44a685d8aca4be01c2a8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Feb 27, 2025, at 22:01, Faizan Akram Dar wrote: > Hi, >=20 >=20 > On Thu, 27 Feb 2025, 20:55 Paul M. Jones, wrote: >>=20 >> > On Feb 25, 2025, at 09:55, ignace nyamagana butera wrote: >> >=20 >> > The problem with your suggestion is that the specification from WHA= TWG and RFC3986/3987 are so different and that the function you are prop= osing won't be able to cover the outcome correctly (ie give the developp= er all the needed information). This is why, for instance, Mat=C3=A9 add= ed the getRaw* method alongside the normalized getter (method without th= e Raw prefix). >>=20 >> The two functions need not return an identical array of components; e= .g., the 3986 parsing function might return an array much like parse_url= () does now, and the WHATWG function might return a completely different= array of components (one that includes the normalized and/or raw compon= ents). >>=20 >> All of this is to say that the parsing functionality does not have to= be in an object to be useful *both* to the internal API *and* to userla= nd. >=20 >=20 >>=20 >=20 > It most definitely needs to be an object. Arrays are awful DX wise, th= ere is array shape which modern IDEs like phpstorm support and so does s= tatic analysis but the overall experience remains subpar compared to cla= sses (and objects).=20 I=E2=80=99m curious why you say this other than an opinion about develop= er experience? Arrays are values, objects are not. A parsed uri seems mo= re like a value and less like an object. Just reading through the commen= ts so far, it appears that whatever is used will just be wrapped in libr= ary code regardless, for userland code, but the objective is to be usefu= l for other extensions and core code. In that case, a hashmap is much ea= sier to work with than a class. Looking at the objectives of the RFC and the comments here, it almost so= unds like it is begging to be a simple array instead of an object.=20 =E2=80=94 Rob --15b8458da7fb44a685d8aca4be01c2a8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Thu, Feb 27, 2025, at 22:01, Faizan Akram Dar wrote:
Hi,





--15b8458da7fb44a685d8aca4be01c2a8--