On Thu, Mar 2, 2023 at 5:53 PM Rowan Tommins <rowan.coll...@gmail.com> wrote:
> On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka <bu...@php.net> wrote: > > > It's possible that we might decide to stop supporting some drafts if the > > maintenance burden is too big and usage small but I wouldn't see that as > > something that happens often. But essentially you are right that there > will > > be minimum (draft-04 initially) and maximum (latest implemented draft). > > > > > Thinking about this, particularly if there is the ability to install a PECL > extension which supports different versions from the core PHP version, > perhaps it would be useful to expose a function or constant that lists the > supported versions, so that code needing a particular version could check > for support directly, rather than having to attempt and catch an exception? > > That's a good point. I think a constant should be sufficient. I think the different classes make less sense if $schema is specified as I would think that the $schema should have a priority. So having just default argument using the constant for the cases where it's not specified should be sufficient IMHO. Cheers Jakub