D7018: Allow optional parameters before non-optional ones in PHP

Matthijs Tijink noreply at phabricator.kde.org
Mon Jul 31 14:31:59 UTC 2017


mtijink added a comment.


  The example you provide still works for me. Maybe you meant `function foo($a = 1, $b)`? That did not work previously either, since it would show the following signature: `[returntype] foo($a, $b = 1)`. But that would be useful to show, indeed.
  
  In a way, this code already does two passes, to record how many optional/non-optional arguments there are, but I see what you mean. The DUChain code now assumes that any default argument appears at the end of the argument list (and does not store anything for earlier arguments), which is why I chose this approach. I'll check if changing that behaviour is not too difficult.

REPOSITORY
  R52 KDevelop: PHP Support

REVISION DETAIL
  https://phabricator.kde.org/D7018

To: mtijink, #kdevelop, kfunk
Cc: kfunk, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170731/ad75ba97/attachment.html>


More information about the KDevelop-devel mailing list