<table><tr><td style="">mtijink created this revision.<br />mtijink added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6915" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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.</p>

<p>There is one exception: when the default value is <tt style="background: #ebebeb; font-size: 13px;">null</tt>, PHP changes the allowed types to be passed to <tt style="background: #ebebeb; font-size: 13px;">typehint|null</tt>. In fact, before PHP 7.1, this was the only way to allow passing <tt style="background: #ebebeb; font-size: 13px;">null</tt> instead of an object when a typehint was used.</p>

<p>This diff implements this: when a <tt style="background: #ebebeb; font-size: 13px;">null</tt> default type is passed, the argument type will be <tt style="background: #ebebeb; font-size: 13px;">typehint|null</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R52 KDevelop: PHP Support</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6915" rel="noreferrer">https://phabricator.kde.org/D6915</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/helper.cpp<br />
duchain/tests/duchain.cpp<br />
duchain/tests/duchain.h</div></div></div><br /><div><strong>To: </strong>mtijink, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, KDevelop, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>