What is "_:" ?

Answered

Hi,

I am relatively new PHPStorm user and once in a while I see in my code an icon added by the IDE, which is an underscore followed by a colon. Below I`m attaching a screenshot of what I mean. Can anyone please explain to me what it means.

3 comments

>... or perhaps it's just the param name :-?

Correct -- if you look at those function declarations (how those params are declared in PhpStorm stubs -- Ctrl+Click to get there) that $_ is used as a parameter name for such variadic parameter.

2

Hi there,

So far that looks like Parameter Name Hints: https://www.jetbrains.com/help/phpstorm/viewing-reference-information.html#parameter-hints

That particular one must be representing an optional "unlimited" parameter (variadic parameter) -- e.g. var_dump() or sprintf() etc -- they have no fixed number of parameters and can accept 1, 2, 3, 4, 5... 10 of them.

0

... or perhaps it's just the param name :-?

0

Please sign in to leave a comment.