@@ 23-25 (lines=3) @@ | ||
20 | ||
21 | $newState = array_merge($state, array(spl_object_hash($var))); |
|
22 | $newClasses = array_merge($classes, array(get_class($var))); |
|
23 | if(count(array_keys($state, spl_object_hash($var), true)) > 1) { |
|
24 | throw new \RuntimeException('Nesting cycle: '.implode(' -> ', $newClasses)); |
|
25 | } |
|
26 | ||
27 | return $this->doSerialize(call_user_func_array($handler, array($var)), $handlers, $newState, $newClasses); |
|
28 | } |
@@ 38-40 (lines=3) @@ | ||
35 | ||
36 | $newState = array_merge($state, array(spl_object_hash($var))); |
|
37 | $newClasses = array_merge($classes, array(get_class($var))); |
|
38 | if(count(array_keys($state, spl_object_hash($var), true)) > 1) { |
|
39 | throw new \RuntimeException('Nesting cycle: '.implode(' -> ', $newClasses)); |
|
40 | } |
|
41 | ||
42 | $this->doSerialize($arr, $handlers, $doc, $parent, $handlers->getRoot(get_class($var)), $newState, $newClasses); |
|
43 |