Commit 9149c355143 for php.net
commit 9149c3551434d48220d452ea42438d4cb49b7c89
Author: David Carlier <devnexen@gmail.com>
Date: Sat Nov 22 06:03:41 2025 +0000
Fix GH-20554: php_cli_server() get http status as string build issue.
due to the signature of this helper it needs to be const also
bsearch key argument needs to be too.
close GH-20556
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 8d67fb2864c..df01d3df911 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -304,7 +304,7 @@ static int status_comp(const void *a, const void *b) /* {{{ */
static const char *get_status_string(int code) /* {{{ */
{
- http_response_status_code_pair needle = {code, NULL},
+ const http_response_status_code_pair needle = {code, NULL},
*result = NULL;
result = bsearch(&needle, http_status_map, http_status_map_len, sizeof(needle), status_comp);