Highlight/JsonRef.php
private function getPaths(&$s, $r = "#")
    {
        $this->paths[$r] = &$s;
        if (is_array($s) || is_object($s)) {
            foreach ($s as $k => &$v) {
                if ($k !== "\$ref") {
                    $this->getPaths($v, $r == "#" ? "#{$k}" : "{$r}.{$k}");
                }
            }
        }
    }
private function getPaths(&$s, $r = "#")
    {
        $this->paths[$r] = &$s;
        if (is_array($s) || is_object($s)) {
            foreach ($s as $k => &$v) {
                if ($k !== "\$ref") {
                    $this->getPaths($v, $r == "#" ? "#{$k}" : "{$r}.{$k}");
                }
            }
        }
    }
private function getPaths ( & $ s , $ r = "#" ) { $ this -> paths [ $ r ] = & $ s ; if ( is_array ( $ s ) || is_object ( $ s ) ) { foreach ( $ s as $ k => & $ v ) { if ( $ k !== "\$ref" ) { $ this -> getPaths ( $ v , $ r == "#" ? "#{$k}" : "{$r}.{$k}" ) ; } } } }
Recurse through the data tree and fill an array of paths that reference
the nodes in the decoded JSON data structure.

@param mixed  $s Decoded JSON data (decoded with json_decode)
@param string $r The current path key (for example: '#children.0').
Recurse through the data tree and fill an array of paths that reference the nodes in the decoded JSON data structure .