public function __construct($key, $value, RedBlackTree $left, RedBlackTree $right, $color, $isRoot) { $this->key = $key; $this->value = $value; $this->left = $left; $this->right = $right; $this->color = $color; $this->isRoot = $isRoot; $this->height = 1 + max($left->height(), $right->height()); }