Scapegoat self-balancing binary search tree in PHP