[php-src] PR #22589: Zend: suggest similar names for undefined function/method/class errors
| From: | jorgsowa | Date: | Sat, 04 Jul 2026 11:29:31 +0000 |
| Subject: | [php-src] PR #22589: Zend: suggest similar names for undefined function/method/class errors | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36822@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22589
Author: jorgsowa
An idea that I came up with during the implementation of case-sensitive PHP. Small DX improvement
over the typos and mistakes in function/classes names.
Because this covers the case of an undefined function, it shouldn't decrease the performance of
a properly working application.
Adaptive threshold: names under 8 characters must be within edit distance 1 to be suggested; names
8+ characters allow distance 2. This avoids noisy suggestions for short identifiers (a 1-character
edit on a 4-letter name is a big relative change) while still catching multi-typo mistakes in longer
names.
We can extend it to constants, etc., if the idea is good enough.