I am concerned about possible recursion.
What if by mistake 'jsonSerialize()' will return self instance:
<pre><code>public function jsonSerialize() {
    return $this; // possible developer mistake
}
</code></pre>
Then program will fall into an infinite recursion.
Should be add aditional check here?
How native 'json_encode' handles such situation?