diff --git a/UPGRADING b/UPGRADING index a22bc46328e90..f61c352c21b39 100644 --- a/UPGRADING +++ b/UPGRADING @@ -66,6 +66,9 @@ PHP 8.3 UPGRADE NOTES 3. Changes in SAPI modules ======================================== +- $_SERVER['SERVER_SOFTWARE'] value from the built-in CLI server changed + to make it compliant with RFC3875. + ======================================== 4. Deprecated Functionality ======================================== diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index e59037ac2e8d3..8ea04137d1229 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -696,7 +696,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */ } } { - zend_string *tmp = strpprintf(0, "PHP %s Development Server", PHP_VERSION); + zend_string *tmp = strpprintf(0, "PHP/%s (Development Server)", PHP_VERSION); sapi_cli_server_register_known_var_str(track_vars_array, "SERVER_SOFTWARE", strlen("SERVER_SOFTWARE"), tmp); zend_string_release_ex(tmp, /* persistent */ false); } diff --git a/sapi/cli/tests/php_cli_server_002.phpt b/sapi/cli/tests/php_cli_server_002.phpt index 2daf6aad73107..d2b561b8bb6bc 100644 --- a/sapi/cli/tests/php_cli_server_002.phpt +++ b/sapi/cli/tests/php_cli_server_002.phpt @@ -14,7 +14,7 @@ var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS)); ?> --EXPECTF-- string(%d) "string(%d) "%sphp_cli_server_002" -string(%d) "PHP %s Development Server" +string(%d) "PHP/%s (Development Server)" string(%d) "localhost" string(%d) "%s" "