Re: Exposing jsonSerialize's depth
| From: | Stanislav Malyshev | Date: | Mon, 16 Jan 2017 01:51:46 +0000 |
| Subject: | Re: Exposing jsonSerialize's depth | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97771@lists.php.net to get a copy of this message | ||
Hi!
> For short the thing is: "We have objects that do dynamic loading and
> there might be recursions. We could use recursion depth to decide
> when we want to do dynamic loading and when not.
>
This looks like a hack covering for deficient design. Having objects
that look differently depending on hidden parameters without anybody
explicitly modifying them is a recipe for very hard to track bugs. I
don't think we should encourage this.
There are ways to present serialized view of the object (sleep/wakeup,
Serializable, etc.) but I don't think depth has anything to do with it.
--
Stas Malyshev
smalyshev@gmail.com