- Output for 8.1.2 - 8.1.28, 8.2.10 - 8.2.19, 8.3.0 - 8.3.7
<?php
class Foo {
public function __construct(string $optional = null, string $mandatory = null) {
if($mandatory === null) {
throw new \InvalidArgumentException('…');
}
}
}
new Foo(mandatory: 'bar');