Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122177 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94363 invoked from network); 18 Jan 2024 20:08:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jan 2024 20:08:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1705608576; bh=Dtlso/j8aMMlPo/gfj6Cq/R/bNsrhnFnm+6y2IoZo6Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OQCd5Vpsa++Ip+MGLIae3SMdemdQwWR1qrapneikIk0EwEApSphp4uuZuGY3dCdBM f8nKR5GggElB7bsaKUfoPTTd3jfAMt13NzWJ00QVYxWHga1VHulR4/lq6G7ViIUTqD bJPLqnipjXlVgLOqhK+2BMcV5v2V9LLIsMxCVjdC7t+/KfQ66Lu3YF1UiX7kjFvgfF V0YCFPNcZhOqV1BAGmfE8xBU2GGXVB1TlEn+Jvl+lpYNaiDph6lrPcvNwZxKiXID1C TDeyXabJ0TmC64QISxfMuzSyO3HaWMDI+61mNE63A+/jznAb2odBWvacTaHQ6Es/Xo KuMoTmxcxbo7Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A0FEE18004A for ; Thu, 18 Jan 2024 12:09:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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, 18 Jan 2024 12:09:34 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-33678156e27so1169f8f.1 for ; Thu, 18 Jan 2024 12:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705608532; x=1706213332; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jdNkJ8RZZyf8fzYRqgQCpB3ZuIXkS8/ct2OviQe5ACs=; b=fs0EuFoPnOdk2lnFvCMsy6EhcdfeLWKVdWDSgfJAwP2VNGXaJye8YqHRWlR5aAUTnS 3oMBobCBL45PMjk364fPw/uzTlsFqhjldTRjRnE8BRoX0vC/XIz5n4wrd0rax0QmrHpz IJYNEIZurE06UPV7lFdROx0z2XEvB8pXB822VNtMsJ3nsp7gHVRK1mTlsbw2CSxZ6I4e S5itbAbsaF6pAObI16v+Fw1Tzv73mhN4ItOFycP8gZAXQUo8mGAjiSGh8Y2CtXnbTx+u 3YOMo+h1FpuRz029raweSiSnTF1kBPskcRQUy9TAFc7ara5O0Rkxvw2joGfT32GkW3IY OHvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705608532; x=1706213332; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jdNkJ8RZZyf8fzYRqgQCpB3ZuIXkS8/ct2OviQe5ACs=; b=sJh2zpFlCzH41wfhfC47aEM+X24ur68Jn3YHPmov7xxlxuG9+8/5qEcvXQ7sImP3H4 WaXm8rfGflacrCOq4vzQ9nlAocYKt9jbHu5Ebnty6YzC8LV8zxo62v/aRaa3cnrNLmLs 6d8T3MjfVxtFRyqiP3dccDrAaAxjAp5DviQord36vxJPx1zNXmuttFISOfF0mMGB3vmd qE3VuM3J1H4FQpEGSIhVRe2aBfpMbKHvJ/GpB2FwiPOVGbRQpF/CZ2gN3kkaG076zYgy x3P4Xjh6AoZvRFW4NOY7VQ8m5q0XnnnwVey/F1Z+EO7AdUrT8x/SpqNgvS/d8GsjDkCv OqKw== X-Gm-Message-State: AOJu0Yzh+rwr3FXeTP4cNUQF7FZBZQx0DybB3uMzBJC/CNWk4Qn1K4ED wwYzA+GAtEILgRl4F0wPwqsQCjjg30goOkDkkmGLI44wSE5EvVhzbMUFqled X-Google-Smtp-Source: AGHT+IHFQQxbOaO/dOsmIHLseJ6HpyC1AZ4Zu+JLFKDqbgjjNgaUkEvsQBXhAY3jTJDjmyZx/r66hA== X-Received: by 2002:adf:ed47:0:b0:337:70ad:b37c with SMTP id u7-20020adfed47000000b0033770adb37cmr738892wro.34.1705608532416; Thu, 18 Jan 2024 12:08:52 -0800 (PST) Received: from ?IPV6:2a02:1811:cc83:ee30:8e76:2662:766d:ebaa? (ptr-dtfv04vjm7u23t23d7u.18120a2.ip6.access.telenet.be. [2a02:1811:cc83:ee30:8e76:2662:766d:ebaa]) by smtp.gmail.com with ESMTPSA id f11-20020adff98b000000b00337d5cd0d8asm1670466wrr.90.2024.01.18.12.08.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 12:08:52 -0800 (PST) Message-ID: <921837a7-81bf-4c10-bb79-36eda76e8d5d@gmail.com> Date: Thu, 18 Jan 2024 21:08:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: "Gina P. Banyard" Cc: PHP internals References: <2006cef3-0e8c-49cc-9703-0fa70690a4ae@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Opt-in DOM spec-compliance From: dossche.niels@gmail.com (Niels Dossche) Hi Gina On 18/01/2024 14:05, Gina P. Banyard wrote: > Hello Niels, > > Thank you for the RFC and the thorough overview of the current state. > > I think converting the new aliases to proper classes which have the correct spec behaviour is indeed the way to proceed. > > I do have some questions however, do you really think we need the DOMDocument methods to import modern nodes into legacy documents? > As I can imagine, this would provide fewer incentives for users to move to the new spec compliant classes. It's a double-edged sword: if we don't provide it, it becomes harder to migrate and it may take a longer time to do so. If we do provide it there may be fewer incentives. I think it's necessary as a first step to aid migration, otherwise, if we don't provide this, it's going to become more difficult for library maintainers as they'd have to effectively create two versions of their library in some cases. By creating these methods it may become possible to use libraries that are not yet adapted to the new classes. So depending on your point of view it may even accelerate adoption. One caveat is, as always, that any migration can be hindered if a library you try to use relies on bugs that are fixed in the new classes. > The other thing to clarify is why and when would those return false, compared to the methods that import legacy nodes which never throw? {import,adopt}ModernNode may return false or throw, depending on the $strictErrorChecking property of DOMDocument, when an error occurs. The only possible error case really is when an unsupported node is imported/adopted (e.g. a document itself). The reason we don't have the false return value for {import,adopt}LegacyNode is because the DOM\{XML,HTML}Document class doesn't have a $strictErrorChecking property, i.e. it always uses exceptions. > > Best regards, > > Gina P. Banyard Kind regards Niels