`compare_objects` is only called if the `compare_objects` handlers of both objects match (http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_operators.c#1607). As only `DateTime` and `DateTimeImmutable` share the handler, comparisons with everything else shouldn't be going through it.