> Le 18 mai 2024 à 01:13, Niels Dossche <dossche.ni...@gmail.com> a écrit :
> 
> On 22/04/2024 20:41, Niels Dossche wrote:
>> Hi internals
>> 
>> I'm opening the discussion for my RFC "Add openStream() to 
>> XML{Reader,Writer}".
>> RFC link: https://wiki.php.net/rfc/xmlreader_writer_streams
>> 
>> Kind regards
>> Niels
> 
> Hi internals
> 
> The main complaint that kept coming up in internal communication was the 
> choice of instance methods instead of static methods.
> This has been brought up in this thread too.

Hi,

Now you have a complaint because of the choice of static methods instead of 
instance methods... :-)

You are introducing an inconstancy for subclasses, because:

* As noted in an earlier message, the existing open-like methods 
(XMLReader::XML() and XMLReader::open()) don’t work statically on subclasses 
(they create an instance of the base class, not of the subclass). You must use 
them as instance methods.

* On the other hand, the method you are going to introduce won’t work as 
instance method. You must use it statically.

Please, if you want to make the new method static only, fix first the existing 
ones, so that they also work statically (on subclasses).

(But again, I prefer that all those methods work on instances, as it was the 
case before PHP 8. They shouldn’t have been switched to 
static-but-broken-for-subclasses without discussion.)

—Claude

Reply via email to