protected function getNestedValue($root, $path)
    {
        $node = &$root;

        $segments = explode($this->separator, $path);

        $last = count($segments) - 1;

        for ($i = 0; $i <= $last; ++$i) {
            $node = @$this->getNode($node, $segments[$i]);

            if ($node === null) {
                return null;
            }

            if (!is_scalar($node)) {
                continue;
            }

            if ($i == $last) {
                return $node;
            }

            return null;
        }

        return null;
    }
protected function getNestedValue($root, $path)
    {
        $node = &$root;

        $segments = explode($this->separator, $path);

        $last = count($segments) - 1;

        for ($i = 0; $i <= $last; ++$i) {
            $node = @$this->getNode($node, $segments[$i]);

            if ($node === null) {
                return null;
            }

            if (!is_scalar($node)) {
                continue;
            }

            if ($i == $last) {
                return $node;
            }

            return null;
        }

        return null;
    }
protected function getNestedValue ( $ root , $ path ) { $ node = & $ root ; $ segments = explode ( $ this -> separator , $ path ) ; $ last = count ( $ segments ) - 1 ; for ( $ i = 0 ; $ i <= $ last ; ++ $ i ) { $ node = @ $ this -> getNode ( $ node , $ segments [ $ i ] ) ; if ( $ node === null ) { return null ; } if ( ! is_scalar ( $ node ) ) { continue ; } if ( $ i == $ last ) { return $ node ; } return null ; } return null ; }
Search inside an hierarchy by a nested key.

@param mixed  $root (object|array|class name)
@param string $path

@return mixed
Search inside an hierarchy by a nested key .