A parameter accepting “a string or something that becomes one” had no type to express it, so it was either untyped or the caller had to cast.
public function log(string|Stringable $message): void
{
$this->write((string) $message);
}
// and the part that makes it work retroactively:
// any class with __toString() implements Stringable AUTOMATICALLY,
// whether or not it declares it. no code changes anywhere.
The automatic implementation is unusual for PHP and is what makes this useful immediately — every existing class with __toString satisfies the type without being touched. Declaring it explicitly is still worth doing because it documents intent and because a class that declares it and forgets the method is a compile error rather than a runtime one. PSR-3 adopted this immediately, which is why logger signatures changed in the same period.