Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125367 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 B51261A00BD for ; Sat, 31 Aug 2024 00:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725063153; bh=j5bKZS3rosp0ii8ZHeSUEK5oF/2Fes7ZlKdgzLS/1G4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=dNAEJnBdJG+OVrRHcY1WsGwqkM/dczBfAJfrqEY8kEeJyhKUbjfPdyGMnnN5RLYHu QgpbRL0rQ7u8n9z1XCjIebBr+GSrJUUMn7WEXBvpmUgm3peVx9t+H0ao7+8esHi3OM tmgDwwZMdrdNktkRKm4FxMHcVrnKytzVyArx4RjKr6GiK723hmRQy1GXzjH837wVsM aiELp7vhZVhGt4Fl99W+6BMZ+2+0Vb+EHTr2kOyrMlPBjafrzOoXpk84zYyI0ZE5je HxL9MmQNPwGwF3BBCFK6Ee7QhoTi+I8MNOH4irt1giLK0xVcr0eZt0TW1GNGf0PEtp +IDmVH2JFAtbg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A662E18007C for ; Sat, 31 Aug 2024 00:12:32 +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,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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, 31 Aug 2024 00:12:32 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id 537C613802AA for ; Fri, 30 Aug 2024 20:10:36 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-03.internal (MEProxy); Fri, 30 Aug 2024 20:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding: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=fm1; t=1725063036; x=1725149436; bh=GKi2P2CXOqJTPJPqfLuzn nDoO22596Xp37AFX5844jw=; b=dnKcWUMYI/rUuh3aArYQ98vfDVfI+QwsrRgJO 95WRQw2GoLLdOKtNYUE1mQEkRi6OusvoefNs1g2TpCCg8dzX6T11NjMAwE9hFTZU w7X9dN2MsXTv+TMyRnOlq8ymHEDK6g82kg5ezxs/53F8NA7xRZGw3sGyEl/MWTWi UOXBel4ZbRqt1ZJUMyb3NjpUP44fHx21UFd6pVz29zr4JhAxlW9hhXMPGap2Q6l2 DahGoAa2v3AbvGEAXBkngX/Fs7yMknxjOz4yyYxPP3ALbt8yI1ZBPpti8Y9eZu+G +ESVTRxcWbtgY12+zN0jp80bnoI+IUzB1QEzYGT9t6oYSGQ9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm1; t=1725063036; x= 1725149436; bh=GKi2P2CXOqJTPJPqfLuznnDoO22596Xp37AFX5844jw=; b=W dPaWB6Uzl8nrAswDfvlgBtjzfHEKHD1pSOJbD9ZwV7zJ9AJcCQbEoCFRCTQtpd1l XyJjnmDzUVkDHkuS02FSmpl/GbwfF2jRmI4FfSIRWVp/0YwDqiSn6Ef9C2wTj75O u+6z81BXn6xTvwAd9Fu7FZksgIbyn7wtqVlcFlDsucaiUWzqrSKq3b7nr5fZ0VF3 QyaVFDckZ/f9eWKqrzywkHypwZ3y1F/vetWqsVJN/mvGxEDTd3nCHXtx8IwregRb TyXcLE6SE9IgP2J95IVsRJeyvKSFWxrIFzRmn6fFhzvzk4SX6mHqsLe82+1x8bqw qblqR9a7Pd+J7xANtEuGA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefjedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgurhep ofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhihucfirg hrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqeenucgg tffrrghtthgvrhhnpeeiieeuhffghefftdeftdeludeguddvtedtvdeikefgudduffeihe efveevjeetjeenucffohhmrghinhepphgrrhhtrdhinhenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvg gthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 062FE29C006A; Fri, 30 Aug 2024 20:10:36 -0400 (EDT) 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, 30 Aug 2024 19:10:15 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Mon, Aug 26, 2024, at 2:40 AM, M=C3=A1t=C3=A9 Kocsis wrote: > Hi Ignace, Niels, > > Sorry for being silent for so long, I was working hard on the=20 > implementation besides some summer activities :) I can say that I had > really good progress in the last month and now I think (hope) that I=20 > managed to address most of the concerns/suggestions people mentioned > in this thread. To summarize the most important changes: I'm not fluent enough in the different parsing styles to comment on the = difference there. I do have concerns about the class design, though. Given the improvemen= ts to the language, the accessor methods offer zero benefit at all. Pub= lic-read properties (readonly or otherwise) would be faster and offer no= less of a guarantee. If you want to allow someone to extend the class = and provide some custom logic, use aviz instead of readonly and extender= s can use hooks instead of the methods. The getters don't offer any val= ue anymore. It took me a while to realize that, I think, the fromWhatWg() method is = using an in/out parameter for error handling. That is an insta-no on my= part. in/out reference parameters make sense in C, maybe C++, and basi= cally nowhere else. I view them as a code smell everywhere they're used= in PHP. Better alternatives include exceptions or union returns. It looks like you've removed the with*() methods. Why? That means it c= annot be used as a builder mechanism, which is plenty valuable. (Though= could be an issue with query as a string vs array.) The WhatWgError looks to me like it's begging to be an Enum. I am confused by the new ini value. It's for use in cases where you're= NOT parsing the URL yourself, but relying on some other extension that = does URL parsing internally as a side effect? =20 As usual, I am not a fan of an ini setting, but I cannot think of a diff= erent alternative off hand. --Larry Garfield