Simple binary tree implemenation in PHP