Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124025 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 93A011A009C for ; Sat, 29 Jun 2024 10:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719657298; bh=I5v3vzHy6F9b8U5C/3N/WvYXRVoS0/fS4xU3jxwfe/o=; h=In-Reply-To:References:Date:From:To:Subject:From; b=KS/m15W66YDg9gPtFNxUEAL9iF1oDXGRY8mSTEY5dOP+72T7aEhnUQFVPd2n9cc0W SlxshqJGwZPUaBSYrgddB5KfyCdPvtOydDJjqUcNEdT27qBj5i+U3wvsjQC5EksyTj kIWoD+UN1NW2ZfpdZ8CMwRDWeBl01mPGtL1Q+5+yEzxeajePhObtqSuued+oB6YVcr NGr/xSqnK6kYXbGRhOxlDGbmSdr/lo+acHA57fjoM6DX60yKSfJNOpZ0E5vyxIBXf+ eqOD+7zv9oxLQo76PZUQWihesv975P7d3J8jJzsl16b6EhMb0ZrWjpygwRoTBG/WNZ 6fZ74SHmWecqw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D59C7180F8C for ; Sat, 29 Jun 2024 10:34:57 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (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 ; Sat, 29 Jun 2024 10:34:57 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id BEE3213804EA for ; Sat, 29 Jun 2024 06:33:37 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Sat, 29 Jun 2024 06:33:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=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=fm3; t=1719657217; x=1719743617; bh=I5v3vzHy6F 9b8U5C/3N/WvYXRVoS0/fS4xU3jxwfe/o=; b=E0PsgbSrmnDOZueMZ/90MRh7BE PvxhjBZQ8Rt2M9jdqV0Zd8NC1IPoxGnBABURWig07BEtPd2Nz3sx8NQt1vMvwQlY A5VfG/TIFU0HW9Dp10C3wdrr5Knx5hubeOepOKNcRITLEi0XYzO9GtyNLM8ectq1 zKgDEBkkxlbUMLvrfydYEckfOCk0iSDfzpIA5lOtoBe9sHFL+CDFlEKxc89+sgGX 4CCzuA5fwtik8tn6vCefQOTgNPC1bnFN7fuGz6iVwwgqdJ9ycCOG4WVNmxlw3VoF bckWFE8S346kID+rLT4DtAfImINPb9Xst/FeFlrKIwgSM0vW4lWHCDuhgURQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719657217; x=1719743617; bh=I5v3vzHy6F9b8U5C/3N/WvYXRVoS 0/fS4xU3jxwfe/o=; b=h79j3g53qidbqzr5ozd1G8Bv/wu0A3H1MW+JdOX6sHqB UocMkkGwpczbb44wocctpb9qOsy/wQHEP4YVMdqVwJouOL2uZNn73wxHWroDPI9Y SlyHjNpbcUSqx8gvuUP0i5PM9nbvVQVXrfdKkkoqCa7CCebGkR/wYgIwyzPpmsPw QEws1u/fi1PEaxHbD0VtrKTuvBC/yDajXlX2xnC0PgpBvH3yNpox8HkC1k4R3gRN yzng/BgO3bwz17i+fDYfX09Si8GJOPPlAmN3QMtU++/oXvTkwHgeryGrD5A/59vS 4oOjbC5OgITpajuN2Yme3+7T9DGpQeX6qQOKLqiEkQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtre erreerjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhl vggurdgtohguvghsqeenucggtffrrghtthgvrhhnpeeffeduhfduudeikeekudfghfdugf eljefgkeeghfdvieekledvvdejheetgeetgeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtthhlvggurdgtohguvghs X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4B28C15A0092; Sat, 29 Jun 2024 06:33:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: <5159E0AB-C8B0-4A54-9654-986C1D9C858F@koalephant.com> References: <71a73b87-cc2f-4ee5-a961-7bf2b191fbb6@gmail.com> <5159E0AB-C8B0-4A54-9654-986C1D9C858F@koalephant.com> Date: Sat, 29 Jun 2024 12:33:16 +0200 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API Content-Type: multipart/alternative; boundary=9dc7c13bbfdc4aa99ce650483b098750 From: rob@bottled.codes ("Rob Landers") --9dc7c13bbfdc4aa99ce650483b098750 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Jun 29, 2024, at 11:57, Stephen Reay wrote: >=20 >=20 > > On 29 Jun 2024, at 04:48, Niels Dossche wr= ote: > >=20 > > - It's a bit of a shame that the PSR interface treats queries as str= ings. > > In Javascript we have the URLSearchParams class that we can use as a= key-value storage for query parameters. > > This Javascript class also handles escaping them nicely. >=20 > Agreed this is a weird choice to me, but I'm also not surprised by wei= rd choices via > php-fig (log level constants I'm looking at you) >=20 > We hear all the time how userland is more flexible and can change quic= ker - and yet here we see a potential built in class having a worse api = because it wants to be compatible with an existing userland interface wi= th the same bad api.... >=20 > Cheers >=20 > Stephen =20 I personally ignore PSR when it doesn't make sense to use it. They're ni= ce for library compatibility, but I will happily toss compatibility when= it doesn't make sense to be compatible. This might be one of those case= s as there is no reason it has to be PSR compliant. In fact, a wrapper m= ay be written to make it compliant, if one so chooses. I suspect it is b= etter to be realistic and learn from the short-comings of PSR and apply = those learnings here, vs. reiterating them and "engraving them in stone"= (so to speak). =E2=80=94 Rob --9dc7c13bbfdc4aa99ce650483b098750 Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jun 29,= 2024, at 11:57, Stephen Reay wrote:


> On 29 Jun 2= 024, at 04:48, Niels Dossche <dossche.niels@gmail.com> wrote:

<= /div>
> - It's a bit of a shame that the PSR interface treats que= ries as strings.
> In Javascript we have the URLSearchP= arams class that we can use as a key-value storage for query parameters.=
> This Javascript class also handles escaping them nic= ely.

Agreed this is a weird choice to me, b= ut I'm also not surprised by weird choices via
php-fig (lo= g level constants I'm looking at you)

We he= ar all the time how userland is more flexible and can change quicker - a= nd yet here we see a potential built in class having a worse api because= it wants to be compatible with an existing userland interface with the = same bad api....

Cheers

<= /div>
Stephen  

= I personally ignore PSR when it doesn't make sense to use it. They're ni= ce for library compatibility, but I will happily toss compatibility when= it doesn't make sense to be compatible. This might be one of those case= s as there is no reason it has to be PSR compliant. In fact, a wrapper m= ay be written to make it compliant, if one so chooses. I suspect it is b= etter to be realistic and learn from the short-comings of PSR and apply = those learnings here, vs. reiterating them and "engraving them in stone"= (so to speak).

=E2=80=94= Rob
--9dc7c13bbfdc4aa99ce650483b098750--