Which programming language is this?
final class Money
{
public function __construct(
public readonly int $cents,
) {}
public static function zero(): static { return new static(0); }
}
Answer: PHP
Constructor property promotion with
Play Programming Languages ▸
public readonly int $cents and the static return type are modern PHP.