PHP allows default values for function arguments, even with typehints set. This does not affect the type given to the function because PHP converts it to declared type.
There is one exception: when the default value is null, PHP changes the allowed types to be passed to typehint|null. In fact, before PHP 7.1, this was the only way to allow passing null instead of an object when a typehint was used.
This diff implements this: when a null default type is passed, the argument type will be typehint|null.