Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124100 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 12CCE1A009C for ; Sun, 30 Jun 2024 14:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719758567; bh=9xKMUwqGT+swxnSYVpbSx1Z4o3a3EpiRopLqt4zyyr4=; h=In-Reply-To:References:Date:From:To:Subject:From; b=WaR6llLk9HJ8oCWKZWP402FcVuPNxOEw/AYDp8dGTTqk91LAFCiS7nJ9TPCT9hsdU NgmJ6+TbZewPPybFk9d62r92X8jJypNm/NowWz0aQYIz1cMT8FsJjd/uktoEzQXZ4I s50Y7m15PavZZPv3ZZ2n0PbHWpNIIW7POKR17H95NetVnpMKQgWT6Nz758ZulxajIw 2cdzfIDYpDolv/RefMrFZyqTdlMBVYaDtTY9yFBJyQFAW2IIB+DzBEK5IQGpoov8fJ wagUM0+xCDmJWAAGMv2D9fXMUCZDqxV++jE6h9IIiz240fJKjYKb57mN56li6mvMGg 87OBcTleGdQhw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AFF2C1801D9 for ; Sun, 30 Jun 2024 14:42:46 +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, SPF_HELO_PASS,SPF_NONE,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 wfhigh1-smtp.messagingengine.com (wfhigh1-smtp.messagingengine.com [64.147.123.152]) (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 ; Sun, 30 Jun 2024 14:42:46 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id 46E0A180009D for ; Sun, 30 Jun 2024 10:41:24 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 30 Jun 2024 10:41:24 -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=fm2; t=1719758483; x=1719844883; bh=jSlXb03ynfPliUhdk9iVv Y4ywTklcxLh/RVPL22OywE=; b=ExKFF0G8bQwYodo962uR4Qm0c0jBhrOcdiOGy xY+BsOPILlP9B48b6jEqp8iBy9WOGpQRW7J2XBzAbkAtEgYPU0Tot1lNdeZT/n6X vjE6DSCKjUff3yv81ExQOM0cKYb5B9Oi43M3F+xJnMxG97ALZbwT1J9ow7lTSwHH JNGUyasl25od9bb4egZOluOvPsng6xHYAomYOl9USD8orTHFvLo0ILFym9NEN6mS /FDkxD/XzR7GppeYMici87j8pBPnif7Z5KasjQdl6GESlieCTazIgzpYWD2SQOXz +QUFn6JC9BKrk6rDAuHcwkmHib+TehVhXneFXQtXyOxc/DT0Q== 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=fm2; t=1719758483; x= 1719844883; bh=jSlXb03ynfPliUhdk9iVvY4ywTklcxLh/RVPL22OywE=; b=X qBrhbvdFSH/alLiIu8KP1hFJqUGpfMK6r7wvLqhSGKTy9icC4T5ELxq9fti4TMDv DkgSOAVPw776UNCleuzd5ghg1cvLCtYYU1QqGQriEBYUmeqNJuHF38NsOcmLFzWn diBltJX11/YCO2b9STZqQwknJgOVYN6iOyMtfqy+NF7wLazZ9BUQ/C4Sv4j0JvJH 4X73nfIg2zlVG9Os8jx27MTI9GgIJh6XCFdNAQzv/UAoYJ9IawKpjmybGnoYoVZE kYbEI8c5xYpROJlyDFjyKjjAHFqMDmnraptXEuNP5XkPGulPEnrGaqs7SQQ86xkc 7PsXVBiJmQnahZyzMlP+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddugdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeffffffjeffudfggeevvdeitdetvdfgjefffeffjeel feejteevheeghffhvdfgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8D4991700093; Sun, 30 Jun 2024 10:41:23 -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: References: Date: Sun, 30 Jun 2024 09:41:02 -0500 To: "php internals" 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 Sun, Jun 30, 2024, at 1:00 AM, M=C3=A1t=C3=A9 Kocsis wrote: >> It mirrors the interface, but it can=E2=80=99t be swapped out for a U= riInterface instance, especially since it can=E2=80=99t be extended, so = I wouldn=E2=80=99t consider it compatible. I would still need to write a= compatibility layer that composes Url\Url and implements UriInterface. > > I guess my words were slightly misleading: what I should have written=20 > is that the methods themselves are compatible. >=20 >> Since PSRs are concerned with shared interfaces and this class is fin= al and does not implement any interfaces, I=E2=80=99m not sure how you e= nvision =E2=80=9Ca next iteration=E2=80=9D of PSR-7 to use this directly= , unless what you mean is that UriInterface would be deprecated and appl= ications would type directly against Url\Url. > > Yes, I meant the latter exactly. If we had a well-usable URL object=20 > representation in the standard library, then there would be no need to=20 > have an userland interface as well (unless they have different behavio= r=20 > or purpose). Analogically, we have DateTimeImmutable, and there is no=20 > PSR for a date time interface. (I know there is Carbon and other=20 > libraries, but they are for convenience, not for interoperability). I cannot speak on behalf of FIG here, but as a long-time member of FIG a= nd a member of the Core Committee, I would urge you to *not* try to make= a core Url object compatible with UriInterface. It's solving a slightl= y different problem, using a language that is very different (PHP 8.4 vs= 5.5 or so), with somewhat different constraints. Instead, let's make sure that any new Url object is *composable* by PSR-= 7 UriInterface. A UriInterface implementation that is backed by a Url o= bject internally should be an easy task to do if anyone wants, and we sh= ould make sure we don't do anything that makes that unnecessarily hard, = but right now the language is simply not capable of making core Url a dr= op-in replacement for UriInterface, so let's not even try. Whether that means Url should be readonly or not, have getters/setters/w= ithers, split authority into user:pass, etc. are things we should discus= s on their own merits, not based on "well PSR-7 did it this way over 10 = years ago, so we'll just do that." --Larry Garfield