Re: [RFC] [Discussion] Add openStream() to XML{Reader,Writer}
| From: | Claude Pache | Date: | Tue, 21 May 2024 19:58:34 +0000 |
| Subject: | Re: [RFC] [Discussion] Add openStream() to XML{Reader,Writer} | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123387@lists.php.net to get a copy of this message | ||
> Le 21 mai 2024 à 21:00, Matthew Weier O'Phinney <mweierophinney@gmail..com> a
> écrit :
>> (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.)
>
> Fixing the existing ones would be a potential BC break, depending on whether or not instance
> usage is completely eliminated.
Yes, of course. But there exist options that don’t make the API even more inconsistent than it
already is. I hereby propose:
*
XMLReader::fromUrl() as replacement for (new XMLReader)->open()
* XMLReader::fromString() as replacement for (new XMLReader)->xml()
… which would make me happy. (The old, inconsistently-named, instance-and-semi-broken-static
methods could be kept for BC and marked as soft-deprecated in the manual.)
—Claude