Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127142 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 F33851A00BC for ; Thu, 17 Apr 2025 20:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744923396; bh=HnXB8DiMzxjO6u2eGn6NH8tZPYBkFDtsj1nbvpbZ8XQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Fg9SbC3OyHpFJhQSjUOjFQRCR3nCFD9SRedCT01vdAf5rm5Xpef/4N/JqToMpDlfr 44Ym8q0mv1s4BuglVl7a959MtVNJDjox+hO3Yk+wSgUfR40NjZfdli8t+6R+xogpjf Lsyuv3YA/N+J1kDf+JkWAov7xvmD2DUyhAlqIQrz2lSG3SJpR8OOcnIEdii5XJmolK CejVupYK5fgeDd5QaPkobzTy6GgRjGHquwnx/PDp8vFkJy3zy7BVNJcrze5hK9wpZA 7StHEbN3rMw3VKRkujwcmDWZbbFI3+oAsFwG58VlcxghGENX6h4GzpBspprHQy6Ywb 62cbKhA4ssPBw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2B38B180034 for ; Thu, 17 Apr 2025 20:56:35 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 17 Apr 2025 20:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1744923534; bh=TrjYxg8gza93IEf/2w/KpsIvo3Owyeg1oeNP7d9X3IM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=dthQvXsuKvN4j5/UMybUSoWrkW77Keku/jOgmbSz2y1J5h9eC9XwUGSK1SQiRmNdF 2wEh2TX6/ppGJZ+2NJL9C+CXbQdZYOB6b2sNIn6NjSh/7UIMfHngFq5Aj79O5IUkMl EbPMDKRb0OY5GEfH3geVvMKG4wKIirCCyalMgfo0MD+iODYg36r8seBCZrmTF67QGN +nWUZCAw9KtHtRCfq1vCkQum4RdZFLNjoPEQNcjcUzEGT4OR+PfrM1jA8Fxg1gbn0v fwhKguZjj1B9MQabYQ/4TUQUOUEgNT7IqKasqZPBvQv1BZysAPyKcXsRZbxXOQRiFc V0b7+vKkFt3DQ== Message-ID: Date: Thu, 17 Apr 2025 22:58:53 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: "Paul M. Jones" , Internals Cc: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= References: <1BCB4144-231D-45EA-A914-98EE8F0F503A@automattic.com> <8E614C9C-BA85-45D8-9A4E-A30D69981C5D@automattic.com> <8df04e01-deac-404b-beb7-cd982423db63@bastelstu.be> <33427cd03035ef084245c44290b56a55@bastelstu.be> <0aa1eefc3941bdea0092e935074daa58@bastelstu.be> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 4/17/25 22:47, Paul M. Jones wrote: > As such, the _InvalidUriException_ would better extend from _LogicException_. No. There is a de facto policy of “not using SPL exceptions in new code”. The replacement for LogicException is the Error hierarchy. Also, as you quoted yourself, LogicException would be not appropriate to use as the base for InvalidUriException, since passing invalid URIs is not a programming error. The point of the URI classes is that they validate URIs, thus malformed inputs are expected in correctly written code. See also https://github.com/php/php-src/pull/9220 for the rationale behind the exception hierarchy in ext/random (which is the first API that was rewritten for “modern PHP”). The choices there also served as the basis for the new ext/date hierarchy in PHP 8.3: https://wiki.php.net/rfc/datetime-exceptions Best regards Tim Düsterhus