Hi

Am 2026-01-22 17:26, schrieb Rowan Tommins [IMSoP]:
The PHP equivalent would be something like this:

$f = (DateTimeImmutable)?->format('c');

See my reply to Mathieu on why this specific one wouldn't work.

Or, slightly more readable but less consistent with casts:

$f = (? as DateTimeImmutable)->format('c');

That would work, but indeed would not solve the reordering case. I also feel it is inventing more new syntax than the current “scope-resolution-operator” syntax the RFC uses (which is not just used for static method calls).

Best regards
Tim Düsterhus

Reply via email to