> > >> What BC break are you talking about? There is no need for using the > parameter in old codes. Even if we pass that depth to jsonSerialize > >> doing something like: "public function jsonSerialize() {...}" will > still work without any problems. > > That BC break: https://3v4l.org/L1u7q > > And where you have it like that? Yes, if I run your example I have that > error. If with patched php/json or non-patched, I can have: > https://3v4l.org/BccPi and it just works. Without any problems.. But now > I understands what you meant by documentation, > if you want to describe interface JsonSerializable with PHP. Yes then if > you do it like that it causes BC problems. > If you just leave it like it is, it works. Granted it's kind of weird > then. With BC problem I don't see a problem seeing this in some > future PHP version that has that BC change. >
Even if you leave the interface as is and just pass the parameter additionally, it could have been extended by users just like in your example and pass a wrong value then. Regards, Niklas