diff --git a/docs/annotating_code/type_syntax/array_types.md b/docs/annotating_code/type_syntax/array_types.md index 9a6ff692e75..7a3c00f96e5 100644 --- a/docs/annotating_code/type_syntax/array_types.md +++ b/docs/annotating_code/type_syntax/array_types.md @@ -203,6 +203,17 @@ $options['verbose'] = isset($options['verbose']); handleOptions($options); ``` +`...` is a shorthand for `...` you can use other array generic types to provide more information about the open shape. + +```php +// This is an open array +/** @param array{someKey: string, ...} */ +// Which is the same as +/** @param array{someKey: string, ...} */ +// But it can be further locked down with a shape ... +/** @return array{someKey: string, ...} */ +``` + ## Callable arrays An array holding a callable, like PHP's native `call_user_func()` and friends supports it: