Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121180 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35772 invoked from network); 29 Sep 2023 17:58:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Sep 2023 17:58:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6F50E18050B for ; Fri, 29 Sep 2023 10:58:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 29 Sep 2023 10:58:45 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id AB81E320090C for ; Fri, 29 Sep 2023 13:58:44 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Fri, 29 Sep 2023 13:58:44 -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:sender:subject :subject:to:to; s=fm2; t=1696010324; x=1696096724; bh=P5mhN8/Jke MSLkJ4GNl61Mb86dAYZVTSuL1VWpEGQUI=; b=qkXNT4Rcovh0Z3s78eCTj/36WY Il8assQWIlyqkMjzPKf3weWbYVIhPu/CatOGZOnYvbUocziPRDHGkM2m1FopcUEV jx62+YJBR4HfzPyLa+lHa0Uc3cw3fpwqPC7FUslbXw0RCzp1Bh9/upporSfG0yUO mP93Ghbfr8DcFuSHJS+xXCXmCCmMhb//nPZ2mmsYz1/pt9hPNDtQ8rQ6W/xvsxDd lNfAmcjZGv7biP22flUiQjmhUcdK4sziCn+3oBTbJyq1rmKj6oWzxqTkbwDC/ZKb 81BphBkE87nqBm9G3hxC6mfUupHqrRZ0lmRv7pG147HlV/P3MLCMMPhegA5A== 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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1696010324; x= 1696096724; bh=P5mhN8/JkeMSLkJ4GNl61Mb86dAYZVTSuL1VWpEGQUI=; b=q eSUHRATQzDp8j9tcHB33CDohzAqn/LVeuQsy2x2YMfewqfU+CIiEYg3S/r1sfrno TgxUCpvzboKSUAvEdmu3JANJdkwDg0hz+HeNJ5TS9NnK8pttfpyfzJQoNSzUBvcd afIDEzNAK51W+iq2ZEZbrhmSRN1Jt/vF2QRQ0NCRIhoIbpT813DcMSlcnjPKt8Sv qdacK9j3GZLg6Sm2tC+lyGc4mPtcG6PVfTs5rE8PESdr5WeynAH03yTpKH5GcVW9 mm6lRPebLDUOwgjwgLqhBvu8HnZuiSdKevhUhs/iLKAC7CwSvguAalQGUbPn8WS5 vbCCU0qJQ9zdQV9U4euxA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddvgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepffffffejffdugfegvedviedttedvgfejffefffej leefjeetveehgefhhfdvgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DD5A41700089; Fri, 29 Sep 2023 13:58:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-ID: <3a80f0a8-c6a1-47d3-bf18-b292037e84f1@app.fastmail.com> In-Reply-To: References: <48c7bb29-a52c-416e-b855-be2746dc7a84@gmail.com> <5ace1060-dd75-4cdc-b5e2-a2ea617df586@app.fastmail.com> Date: Fri, 29 Sep 2023 17:58:22 +0000 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support From: larry@garfieldtech.com ("Larry Garfield") On Fri, Sep 29, 2023, at 5:13 PM, Tim D=C3=BCsterhus wrote: > Hi > > On 9/29/23 18:58, Larry Garfield wrote: >>> \DOMDocument will also use DOM\Document as a base class to make it i= nterchangeable with the new classes. We're only adding XMLDocument for c= ompleteness and API parity. It's a drop-in replacement for \DOMDocument,= and behaves the exact same. The difference is that the API is on par wi= th HTMLDocument, and the construction is designed to be more misuse-resi= stant. \DOMDocument will NOT change, and remains for the foreseeable fut= ure. >>=20 >> Would it make sense then for one of \DOMDocument and DOM\XMLDocument = to extend the other, then? So that, eg, we can type against DOM\XMLDocu= ment and then support both old and new classes? Or are the construction= et al differences enough that is not viable? > > As one of the persons who convinced Niels of this new API design: > > \DOM\XMLDocument extends \DOMDocument doesn't work, because it would=20 > bring in the crappy non-static load*() methods that the new API wants = to=20 > avoid, because their behavior is extremely surprising. > > \DOMDocument extends \DOM\XMLDocument would probably work, but would n= ot=20 > provide an improvement in (backwards) compatibility. > > If you want to support everything, update your type declarations to=20 > either \DOM\Document (which is the new abstract base class) or use uni= on=20 > types. > > Please also keep in mind that this is a new API that needs to live for=20 > 10+ years. It makes sense to make it as clean as possible and fully=20 > opt-in, while not unnecessarily breaking compatibility. Any "extends"=20 > hierarchy will likely result in sadness a few years down the road.=20 > Better make a clean cut. Fair enough, thanks for clarifying. I guess union types are "good enoug= h" for this sort of case. --Larry Garfield