Hi Am 2026-01-23 14:06, schrieb Mathieu Rochette:
`(DateTimeImmutable)?->format("c")` feels a bit weird. Reminds me too much of the null-safe operator.
That's because it is. It's literally the same case of a `DateTimeImmutable` constant with useless parentheses and the null-safe object member access: https://3v4l.org/NebOR#veol
They could have incompatible signatures, yes, but they also could have compatible ones too. It's not a deal breaker. I don't imagine needing this in practice. But I don't see why the language would prevent that; I can already make that mistake with short closures or any methods. For me, it's the role of the static analyzer to tell me if I made such a mistake (or runtime errors ^^).
The signature would need to be “unique” to properly generate the signature of the resulting Closure.
Best regards Tim Düsterhus
