diff --git a/website/src/writing-php-code/phpdoc-types.md b/website/src/writing-php-code/phpdoc-types.md index 93311b30bd..c8a9c343b9 100644 --- a/website/src/writing-php-code/phpdoc-types.md +++ b/website/src/writing-php-code/phpdoc-types.md @@ -327,3 +327,14 @@ All of these names are equivalent: * `no-return` Marking a function or a method as `@return never` tells PHPStan the function always throws an exception, or contains a way to end the script execution, like `die()` or `exit()`. This is useful when [solving undefined variables](/writing-php-code/solving-undefined-variables). + +Int masks +------------------------- + +
Available in PHPStan 1.6
+ +Some functions accept a bitmask composed by `|`-ing different integer values. `0` is always part of the possible values. Some examples: + +* `int-mask<1, 2, 4>` (accepts values that can be composed using `|` from the given integers, and 0) +* `int-mask-of<1|2|4>` (the same as above, but writting as a union) +* `int-mask-of` (accepts values from all constants on `Foo` that start with `INT_`)