Re: [RFC] [Vote] New ext-dom features in PHP 8.4

From: Date: Thu, 20 Jun 2024 18:26:00 +0000
Subject: Re: [RFC] [Vote] New ext-dom features in PHP 8.4
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 20/06/2024 16:28, Matthew Weier O'Phinney wrote:
> 
> 
> On Mon, Jun 10, 2024 at 1:15 PM Niels Dossche <[email protected] <mailto:[email protected]>> wrote:
> 
>     Hi internals
> 
>     I'm opening the vote of my RFC "New ext-dom features in PHP 8.4".
>     RFC link: https://wiki.php.net/rfc/dom_additions_84
> <https://wiki.php.net/rfc/dom_additions_84>
>     Voting runs until 24th of June 21:00 GMT+2.
> 
>     Kind regards
>     Niels
> 
> 
> Question: why is Dom\Document::$head marked as readonly?

The HTML spec defines the head property to be readonly: https://html.spec.whatwg.org/#document
That's why $head is marked readonly.

So I guess the question becomes "why does the HTML spec define it this way?"
I couldn't find a conclusive answer to this, it looks like this has been read-only since
HTML's early days...
I thought about it but don't really see a technical reason why this is the case. If I had to
take a guess I'd say it's for simplicity sake.

> 
> -- 
> Matthew Weier O'Phinney
> [email protected] <mailto:[email protected]>
> https://mwop.net/ <https://mwop.net/>
> he/him

Kind regards
Niels


Thread (6 messages)

« previous php.internals (#123706) next »