I'd prefer the string `\DateTime` here. Maybe just

```php
$comparedValueType = is_object($constraint->value) ? get_class($constraint->value) : gettype($constraint->value);
```