Re: [RFC] [Discussion] Readonly class amendments

From: Date: Thu, 19 Jan 2023 09:12:58 +0000
Subject: Re: [RFC] [Discussion] Readonly class amendments
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-119342@lists.php.net to get a copy of this message
> Le 19 janv. 2023 à 09:01, Máté Kocsis <kocsismate90@gmail.com> a écrit : > > Hi Everyone, > > As discussion apparently stalled, and since we managed to update the RFC > with the recently brought up arguments, we would like to start the vote > soon, possibly early next week, unless someone finds a new topic to discuss. > > Máté > Hi, One shortcoming around readonly classes that I just figured out, is that it is not possible to use them as anonymous class: ```php $c = new readonly class { }; // parse error ``` While it does not makes sense to have abstract and it is not useful to have final in this position, on the other hand, it is perfectly reasonable to have readonly here. (This is especially problematic in case we keep the limitation that only readonly classes may extend readonly classes, because in that case, an anonymous class could not extend a readonly class. However, this is an orthogonal concern.) —Claude

« previous php.internals (#119342) next »