[php-src] PR #23433: ext/readline: declare true as the return type of readline_completion_function()
| From: | lacatoire | Date: | Mon, 24 Aug 2026 07:20:41 +0000 |
| Subject: | [php-src] PR #23433: ext/readline: declare true as the return type of readline_completion_function() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38100@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23433
Author: lacatoire
readline_completion_function() is declared bool, but the function assigns
a static function pointer to rl_attempted_completion_function and then returns
RETURN_BOOL(rl_attempted_completion_function != NULL) — a tautology. The only other
exit is the TypeError from ZPP. true is always returned.
The commit declares true and returns it directly instead of the redundant pointer
comparison.
ksort(), asort(), and natsort() already declare
true in ext/standard, so this follows existing practice.
Changes: readline.stub.php (bool → true),
readline.c (RETURN_BOOL(...) → RETURN_TRUE), regenerated
arginfo, added test.