Use null default types for determining argument type in PHP
Summary: 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`. Reviewers: #kdevelop Subscribers: kdevelop-devel, #kdevelop Tags: #kdevelop Differential Revision: https://phabricator.kde.org/D6915
parent
2c863b8a
Please register or sign in to comment