On Wed, Apr 29, 2020 at 5:36 PM Benjamin Morel <benjamin.mo...@gmail.com> wrote:
> I want my classes to implement JsonSerializable, but this means requiring >> ext-json and bumping the library version. >> > > At the risk of derailing... You can have your class implement the interface unconditionally, then have a polyfill definition in your autoload for cases where it doesn't exist. Obviously, it won't have an impact on calls to json_encode(), but if the interface doesn't exist it's because json_encode() doesn't either, so that should be harmless. :D -Sara