public function next_sibling()
    {
        if ($this->parent === null) {
            return null;
        }

        $idx = 0;
        $count = count($this->parent->children);
        while ($idx < $count && $this !== $this->parent->children[$idx]) {
            ++$idx;
        }
        if (++$idx >= $count) {
            return null;
        }
        return $this->parent->children[$idx];
    }
public function next_sibling()
    {
        if ($this->parent === null) {
            return null;
        }

        $idx = 0;
        $count = count($this->parent->children);
        while ($idx < $count && $this !== $this->parent->children[$idx]) {
            ++$idx;
        }
        if (++$idx >= $count) {
            return null;
        }
        return $this->parent->children[$idx];
    }
public function next_sibling ( ) { if ( $ this -> parent === null ) { return null ; } $ idx = 0 ; $ count = count ( $ this -> parent -> children ) ; while ( $ idx < $ count && $ this !== $ this -> parent -> children [ $ idx ] ) { ++ $ idx ; } if ( ++ $ idx >= $ count ) { return null ; } return $ this -> parent -> children [ $ idx ] ; }
returns the next sibling of node
returns the next sibling of node