Skip to content

Commit

Permalink
Update variadic callable phpdoc example
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jun 9, 2022
1 parent f2ecfa5 commit 5244583
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions website/src/writing-php-code/phpdoc-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ The `callable` typehint has been in PHP for a long time. But it doesn't allow en
* `callable(int $foo, string $bar): void` (accepts an integer and a string, doesn't return anything; parameter names are optional and insignificant)
* `callable(string &$bar): mixed` (accepts a string parameter passed by reference, returns `mixed`)
* `callable(float ...$floats): (int|null)` (accepts multiple variadic float arguments, returns integer or null)
* `callable(float...): (int|null)` (accepts multiple variadic float arguments, returns integer or null)

Parameter types and return type are required. Use `mixed` if you don't want to use a more specific type.

Expand Down

0 comments on commit 5244583

Please sign in to comment.