Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126499 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 EF84F1A00BC for ; Tue, 25 Feb 2025 12:36:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1740486838; bh=gzlVVPevMPzjq82xAhE39FvW1elAKDsNs9Q5IBuS4m0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Bb7Qz+y8z3jz0AytWMMTk2+pFhF8sj0UWe6IXaejqSN/5ilY9R4U/R6g/hQV/yTIv tIPEt4OHYqTx7tHMpzqTjNECpNT4udRXBI+lOpMvKlFge4kwz2Ny7aSmHLRtZclFRc l4t/SQDp86BGdUia2RWEE54KAurWJwhOlCAF2riyfkHSVqv1HIxDMjXJRXba+ypMFS tmSMsT6P7hsq6z+e3mqECFsiiOKDTD4x+ZOkEbWzhDeTnM1oJm/rrkWTweMHdFcsqp DAuMA07JirLQfSHUe3P0GH6PA5km8oRXJroUvzpipl0kBccljn4AR4Zg4ocgKAsC8s Kf5wGlS0YAeAg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A54B180086 for ; Tue, 25 Feb 2025 12:33: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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from premium76-5.web-hosting.com (premium76-5.web-hosting.com [162.213.255.108]) (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, 25 Feb 2025 12:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pmjones.io; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=gzlVVPevMPzjq82xAhE39FvW1elAKDsNs9Q5IBuS4m0=; b=metUlwBrr9dgkNvkvK14QkkWrS o1oSwP8X6jqVY389bUluv6i5f2W+dmvW4YmgR+axuPOTyFIaeYvkfgOR/Wzb7blnwXj5LJgeDFTrx x4kGEqYP44B8J7hQi6oyXHhbELwFg+O4OEydZvmXhkyhbMVH0LwMN/faj6KsmkGBBD5T4x4Sjez+v n09HTu6mfdMOBNsi96V4N6V1bLZfKcaHtwzgNG58rtudA440ILH3d/CwbRvB/qD8TUAMu+MDuV/3Y RwABkUfKzk44lNNq1cLGk09IB/u4AQ7bYCvJpQoOlVjD6ACfrxbDv/nv8hv+Af4WHFgvEFVTs3PlP +boQaayA==; Received: from 107-223-28-39.lightspeed.nsvltn.sbcglobal.net ([107.223.28.39]:63363 helo=smtpclient.apple) by premium76.web-hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tmuAr-000SoZ-1S; Tue, 25 Feb 2025 07:36:32 -0500 Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API In-Reply-To: Date: Tue, 25 Feb 2025 06:36:20 -0600 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <19377F60-FB7F-4E6E-A085-4DCB6CD92234@pmjones.io> References: <811B65CE-1DF0-4A47-937C-4FCB6E945B92@pmjones.io> To: =?utf-8?Q?Tim_D=C3=BCsterhus?= , "Gina P. Banyard" X-Mailer: Apple Mail (2.3826.400.131.1.6) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - premium76.web-hosting.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pmjones.io X-Get-Message-Sender-Via: premium76.web-hosting.com: authenticated_id: pmjones@pmjones.io X-Authenticated-Sender: premium76.web-hosting.com: pmjones@pmjones.io X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched From: pmjones@pmjones.io (Paul M . Jones) Hi there, > On Feb 24, 2025, at 03:36, Tim D=C3=BCsterhus = wrote: >=20 ... >=20 > but had a look at the =E2=80=9Cafter-action summary=E2=80=9D thread = and specifically C=C3=B4me=E2=80=99s response, which you apparently = agreed with: >=20 >> My take on that is more that functionality in core needs to be = =C2=ABperfect=C2=BB, or at least near unanimous. C=C3=B4me Chilliet's full quote goes on to say "And of course it=E2=80=99s= way easier to find a solution which pleases everyone when it=E2=80=99s = for something quite simple" -- the example was of `str_contains()`. > Or perhaps phrased differently, like I did just a few days ago in: = https://externals.io/message/126350#126355 >=20 >> The type of functionality that is nowadays added to PHP=E2=80=99s = standard library is =E2=80=9Cbuilding block=E2=80=9D functionality: = Functions that a userland developer would commonly need in their custom = library or application. >=20 > *Correctly* processing URIs is a common need for developers and it=E2=80= =99s complicated to do right, thus it qualifies as a =E2=80=9Cbuilding = block=E2=80=9D. Agreed. Add to that: > On Feb 23, 2025, at 18:48, Gina P. Banyard wrote: >=20 > Considering that one of the other stated goals of this RFC is to = provide this API to other core extensions, the previous objections do = not apply here. (The previous objections being that this ought to be left in userland.) * * * I'm repeatedly on record as saying that PHP, as a web-centric language, = ought to have more web-centric objects available in core. A _Request_ = would be one of those; a _Response_ another; and as being discussed = here, a _Url_. However, if it is true that ... - "it=E2=80=99s way easier to find a solution which pleases everyone = when it=E2=80=99s for something quite simple" - "The type of functionality that is nowadays added to PHP=E2=80=99s = standard library is =E2=80=9Cbuilding block=E2=80=9D functionality: = Functions that a userland developer would commonly need in their custom = library or application." - "one of the other stated goals of this RFC is to provide this API to = other core extensions" - "Parsing is the single most important operation to use with URIs where = a URI string is decomposed into multiple components during the process." = (from the RFC) ... then an extensive set of objects and exceptions is not strictly = necessary. Something like `function parse_url_whatwg(string $url_string, ?string = $base_url =3D null) : array`, with an array of returned components, = would meet all of those needs. Similarly, something like a `function parse_url_rfc3986(string = $uri_string, ?string $base_url =3D null) : array` does the same for RFC = 3986 parsing. Those things combined provide solid parsing functionality to userland, = and make that parsing functionality available to other core extensions. -- pmj