public static function equals(Node $a, Node $b) { $diff = true; $diff = $diff && $a->id === $a->id; $diff = $diff && $a->data === $b->data; $diff = $diff && NodeList::equals($a->children, $b->children); return $diff; }