[php-src] PR #25891: Suggest the correct casing for unknown named parameters
| From: | LamentXU123 | Date: | Sun, 29 Nov 2026 09:35:49 +0000 |
| Subject: | [php-src] PR #25891: Suggest the correct casing for unknown named parameters | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41181@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25891
Author: LamentXU123
Let's say we have
```php
function example($timeout) {}
example(TimeOut: 10);
```
This will now output
```
Unknown named parameter $TimeOut.
```
With thi s PR, instead I hope it to output
```
Unknown named parameter $TimeOut. Did you mean "timeout:"?
```
Now, when a named argument differs only in ASCII case from exactly one declared parameter, suggest
the correct spelling if that parameter has yet to receive an argument.
The only edge case is we have ambiguous matches like
```
function example($Timeout, $TIMEOUT) {}
example(timeout: 10);
```
This will just output the original message.