Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121078 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79752 invoked from network); 17 Sep 2023 11:28:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Sep 2023 11:28:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EE25F180083 for ; Sun, 17 Sep 2023 04:28:30 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 17 Sep 2023 04:28:30 -0700 (PDT) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-52bcd4db4c0so7871585a12.0 for ; Sun, 17 Sep 2023 04:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694950109; x=1695554909; 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=ooo9L+gg2t+yKMvxmNVXn8nBpC8ShZYlKwco+cmQfsw=; b=NudQFw67JXW8W51mD/e0vcwN3NX96ytufFY1olm92eGdD5KKIxpcp4L2M5LOClID4A W6LStCShlzcfjsTAGYPNJojXWTMAONRBZjlz2l+cuxtKcMvDVw6Oc4iK3N/QlDMbmj/R mWqs7QJ7Ez9cNBCv9sqCpNgoE0g37NQRMeZOmKXZCzxrhn9tqbdRFdZf+z4lNtfmg+2k cnX+KaMINZIXVJ/b+IPcaJymoS2reKdsoPp5eoDQ0AE5C4GHiE0VLdWyFLFOw7JtMMWM kcG/PB4AWZYtzE1Xzv3IufuBh23c1JRMsuz+IsGaZ+ippGg541Z4iT0o+DGsUwhWSV1b I1AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694950109; x=1695554909; 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=ooo9L+gg2t+yKMvxmNVXn8nBpC8ShZYlKwco+cmQfsw=; b=OXg3tdOwd6niFtx4CFFcgwH7UxD+tmzFeTwTe7e5eW7ovHykymNEXuw+LWZVjC6L5Q G9BiuwdRoy9gl4UJpWQ9jEw1Q5PjoAmzFeLjUyko2wLbbG3WGfMH26/LI1jScFbC40Bb jW3W59ntp/bZPZUVOVqL2owbzkwn396eqFczz8h04PMpeRseetBom5Z3lyOz+LMvfMsL GVSCoUgkXBSzIEsUwL3VXwoNO+hxc5gXTtG5pD1zlfIzcx1VJ5FRF04nrFWS5tBeMF1i 6ob94ifq9QjKnpEC1VvPcyVDzjpz99rxssJtCHYz0lZ1tgu4XdFB9GzUosHKbKwIUpNL coMA== X-Gm-Message-State: AOJu0Yy/J+00N4U6OzSEwg6ZAbjkboTMWjGY4UtOtXGcsUb9hkqm+7Wb lE3J0Pri2L1jCRfcEtklpGM= X-Google-Smtp-Source: AGHT+IFvSdv1Q8/5C8vU/LDSewyaUQcvsu1UO+3j9Gd0PL5bP/oc971Wbu5suHh9ZiFIV+j0devFFQ== X-Received: by 2002:aa7:d94b:0:b0:52f:86a1:3861 with SMTP id l11-20020aa7d94b000000b0052f86a13861mr8899090eds.7.1694950108817; Sun, 17 Sep 2023 04:28:28 -0700 (PDT) Received: from [192.168.0.59] (178-117-137-225.access.telenet.be. [178.117.137.225]) by smtp.gmail.com with ESMTPSA id o7-20020aa7d3c7000000b005233deb30aesm4545511edr.10.2023.09.17.04.28.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Sep 2023 04:28:28 -0700 (PDT) Message-ID: <29eb53a7-9aef-4e48-999e-97574f27a9df@gmail.com> Date: Sun, 17 Sep 2023 13:28:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= Cc: PHP Internals References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support From: dossche.niels@gmail.com (Niels Dossche) Hi Alexandru On 9/17/23 11:59, Alexandru Pătrănescu wrote: > On Sat, Sep 16, 2023, 02:17 Niels Dossche wrote: > >> >> We'll add a common abstract base class DOM\Document (name taken from the >> DOM spec & Javascript world). >> DOM\Document contains the properties and abstract methods common to both >> HTML and XML documents. >> >> > Hi, > > Yes looks a lot better. > Great work overall! And thank you for taking on this effort. > > I would have a small suggestion: to make the abstract class an interface. > This will allow even more flexibility on how things can be build further, > suggesting composition over inheritance. > In user land we cannot have interfaces with properties (yet) but in php > internal interfaces we have example with interface UnitEnum that has name > property, extendes by BackedEnum that adds value property. > Right, we discussed the use of an interface internally too. Indeed as you suggest, we chose an abstract class over an interface because of the property limitation. Looking at UnitEnum & BackedEnum (https://github.com/php/php-src/blob/bae30682b896b26f177f83648bd58c77ba3480a8/Zend/zend_enum.stub.php) I don't see the properties defined on the interface. In practice, all enums get the properties of course, just not via the interface. So as we cannot represent the properties on the interfaces (yet), we'll stick with the abstract class for now. > Thank you, > Alex > Kind regards Niels