[GIT-PULLS] [php-src] PR #23433: ext/readline: declare true as the return type of readline_completion_function()

[email protected] (lacatoire)
Newsgroups php.git-pulls
Message-ID <vZsI8AtyQIkOsYSrTxKb7O8R5j7p1F6sfsf5ub1xy8g@main.internal.php.net>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.