public function balance() : int
    {
        return ($this->right ? $this->right->height() : 0)
            - ($this->left ? $this->left->height() : 0);
    }
public function balance() : int
    {
        return ($this->right ? $this->right->height() : 0)
            - ($this->left ? $this->left->height() : 0);
    }
public function balance ( ) : int { return ( $ this -> right ? $ this -> right -> height ( ) : 0 ) - ( $ this -> left ? $ this -> left -> height ( ) : 0 ) ; }
The balance factor of the node. Negative numbers indicate a
lean to the left, positive to the right, and 0 is perfectly
balanced.

@return int
The balance factor of the node . Negative numbers indicate a lean to the left positive to the right and 0 is perfectly balanced .