:sparkles: PHP 8.0 | New `NewNamedParameters` sniff by jrfnl · Pull Request #1423 · PHPCompatibility/PHPCompatibility

@jrfnl

PHP 8.0 introduces named function call parameters:
```php
array_fill(start_index: 0, count: 100, value: 50);

// Using reserved keywords as names is allowed.
array_foobar(array: $array, switch: $switch, class: $class);
```

Ref: https://wiki.php.net/rfc/named_params

This new sniff will detect the use of named parameters based on the support for this in PHPCSUtils as added in PHPCSStandards/PHPCSUtils 235 and PHPCSStandards/PHPCSUtils 383.

Includes unit tests.

**Open question**: should this sniff live in the `FunctionUse` category or in the `Syntax` category ?

@jrfnl jrfnl mentioned this pull request

Dec 5, 2022

40 tasks

wimg

wimg approved these changes Dec 5, 2022

@wimg wimg deleted the php-8.0/new-namedparameters-sniff branch

December 5, 2022 12:08

@jrfnl jrfnl changed the title ✨ PHP 8.0 | New NewNamedParametersSniff sniff ✨ PHP 8.0 | New NewNamedParameters sniff

Sep 8, 2025