From 76a97f56d67a07ee666328482aeba404727b93a2 Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Thu, 28 Aug 2025 14:42:02 +0200 Subject: [PATCH 1/3] Mysqlnd: Removed useless precompilter cond (#19120) --- ext/mysqlnd/mysqlnd_portability.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_portability.h b/ext/mysqlnd/mysqlnd_portability.h index 11ebf4d1bf8ae..20dfe3429edf3 100644 --- a/ext/mysqlnd/mysqlnd_portability.h +++ b/ext/mysqlnd/mysqlnd_portability.h @@ -284,15 +284,8 @@ typedef union { register) variable, M is a pointer to byte */ #ifndef float8get - -#ifdef WORDS_BIGENDIAN -#define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) -#define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) -#else -#define float8get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(double)) -#define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double)) -#endif /* WORDS_BIGENDIAN */ - -#endif /* float8get */ +# define float8get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(double)) +# define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double)) +#endif #endif /* MYSQLND_PORTABILITY_H */ From 5077e1b4e042ca7164244cb62f499615b8c6c370 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 28 Aug 2025 13:44:02 +0100 Subject: [PATCH 2/3] Write up NEWS rules (#19387) * Write up NEWS rules * Tweak commit message example to use GH issues, instead of bugsweb ones * Address comments from review * Update CONTRIBUTING.md with added dot Co-authored-by: Ilija Tovilo --- CONTRIBUTING.md | 101 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a91545fa9bd79..31d893e8d42a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,7 @@ had several contributions accepted, commit privileges are often quickly granted. * [What happens when your contribution is applied?](#what-happens-when-your-contribution-is-applied) * [Git commit rules](#git-commit-rules) * [Copyright and license headers](#copyright-and-license-headers) +* [NEWS file](#news) ## Pull requests @@ -385,11 +386,8 @@ The next few rules are more of a technical nature: later branches) an empty merge should be done. 2. All news updates intended for public viewing, such as new features, bug - fixes, improvements, etc., should go into the NEWS file of *any stable - release* version with the given change. In other words, news about a bug fix - which went into PHP-5.4, PHP-5.5 and master should be noted in both - PHP-5.4/NEWS and PHP-5.5/NEWS but not master, which is not a public released - version yet. + fixes, improvements, etc., should go into the NEWS file. See the section on + [NEWS](#news) below. 3. Do not commit multiple files and dump all messages in one commit. If you modified several unrelated files, commit each group separately and provide a @@ -422,14 +420,13 @@ An Example from the git project (commit 2b34e486bc): 'arg' variable no longer is available. If you fix some bugs, you should note the bug ID numbers in your commit message. -Bug ID should be prefixed by `#`. Example: - Fixed bug #14016 (pgsql notice handler double free crash bug.) + Fixed GH-14009: Fix prototype for trait method. -When you change the NEWS file for a bug fix, then please keep the bugs sorted in -decreasing order under the fixed version. +When you change the NEWS file for a bug fix, then please keep the bugs sorted +under the fixed version. ## Copyright and license headers @@ -453,4 +450,90 @@ New source code files should include the following header block: */ ``` +## NEWS + +The purpose of the NEWS file is to record all the changes that are relevant for +users and developers alike. These could be bug fixes, feature additions, syntax +additions, or deprecations. + +### Format + +Each PHP version has a section, starting with the format: + + {DD} {MMM} {YYY}, PHP {version} + +Such as: + + 06 Jun 2024, PHP 8.1.29 + +In each section, entries are ordered by their extension. Extensions are listed +alphabetically, with the exception of "Core", which MUST be listed first. Each +extension's section starts with: `- {name}:\n` + +For each extension, entries are indented by two spaces, followed by `. ` (a +period and a space). + +Entries MUST start with a capital and end with a period (`.`). The period goes +outside of the `{issue-description}`. + +Each entry SHOULD be followed by the name of the contributor, their php.net +account name, or their GitHub handle if they so choose. + +Entries MUST be wrapped at 80 characters. + +If an entry pertains a bug fix, they MUST be formatted as: + + Fixed bug GH-{number} ({issue-description}). ({contributor}) + +Bug fix entries SHOULD be clustered together, and ordered according to their +issue number. The `{issue-description}` SHOULD represent what the actual bug +fix is about, and not necessarily what the user reported. Edit the description +in the GitHub ticket to match. + +On the rare occasion where a bug from our deprecated bug system is fixed, the +entry MUST be formatted as: + + Fixed bug #{number} ({issue-description}). ({contributor}) + +An example: + +``` +31 Jul 2025, PHP 8.5.0alpha4 + +- Core: + . Added PHP_BUILD_PROVIDER constant. (timwolla) + . Fixed bug GH-16665 (\array and \callable should not be usable in + class_alias). (nielsdos) + . Fixed bug GH-19326 (Calling Generator::throw() on a running generator with + a non-Generator delegate crashes). (Arnaud) + +- OPcache: + . Make OPcache non-optional. (Arnaud, timwolla) + +- OpenSSL: + . Add $digest_algo parameter to openssl_public_encrypt() and + openssl_private_decrypt() functions. (Jakub Zelenka) + ``` + +### Branches + +Depending on what sort of fix it is, or where in the release cycle we are, +different NEWS files must be updated. + +*Security fixes*: In the lowest security-supported branch which received the +security fix, and in each newer branch, except for master unless alpha releases +have been tagged, and a release branch has not been created. + +*Bug fixes*: In the lowest supported branch, and in each newer branch, except +for master unless alpha releases have been tagged, and a release branch has not +been created. + +*Feature additions*: In master only. + +If for some reason a feature is introduced in a branch lower than master, +although this is strictly prohibited by other policies, then the entry must +also be in master. + +## Thanks + Thank you for contributing to PHP! From b27d91993dd6b1c506c81ae1a49684d2cc3eb768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 28 Aug 2025 17:39:55 +0200 Subject: [PATCH 3/3] main: Change the `register_argc_argv` INI default to `Off` (#19473) This partly implements the deprecation of the `register_argc_argv` INI setting by updating the default value to ensure safe behavior when no INI file is loaded. The actual deprecation warning will follow separately. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive --- main/main.c | 2 +- php.ini-development | 15 ++++----------- php.ini-production | 15 ++++----------- tests/basic/011.phpt | 4 ++++ tests/basic/011_windows.phpt | 22 ++++++++++++++++++++++ 5 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 tests/basic/011_windows.phpt diff --git a/main/main.c b/main/main.c index eb842474240fd..a48dd14b7f287 100644 --- a/main/main.c +++ b/main/main.c @@ -783,7 +783,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("report_zend_debug", "0", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals) STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals) STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN("register_argc_argv", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("auto_globals_jit", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("short_open_tag", DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) diff --git a/php.ini-development b/php.ini-development index 9e7039e9d1bf0..6a217d30cb7ae 100644 --- a/php.ini-development +++ b/php.ini-development @@ -129,11 +129,6 @@ ; Development Value: 4096 ; Production Value: 4096 -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - ; request_order ; Default Value: None ; Development Value: "GP" @@ -665,14 +660,12 @@ request_order = "GP" ; that were passed when the script was invoked. These arrays are extremely ; useful when running scripts from the command line. When this directive is ; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. +; a script is executed. For security reasons, this feature should be disabled +; for non-CLI SAPIs. ; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off +; This directive is deprecated. ; https://php.net/register-argc-argv -register_argc_argv = Off +;register_argc_argv = Off ; When enabled, the ENV, REQUEST and SERVER variables are created when they're ; first used (Just In Time) instead of when the script starts. If these diff --git a/php.ini-production b/php.ini-production index 17752f80918cb..09c048a1efe25 100644 --- a/php.ini-production +++ b/php.ini-production @@ -129,11 +129,6 @@ ; Development Value: 4096 ; Production Value: 4096 -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - ; request_order ; Default Value: None ; Development Value: "GP" @@ -667,14 +662,12 @@ request_order = "GP" ; that were passed when the script was invoked. These arrays are extremely ; useful when running scripts from the command line. When this directive is ; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. +; a script is executed. For security reasons, this feature should be disabled +; for non-CLI SAPIs. ; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off +; This directive is deprecated. ; https://php.net/register-argc-argv -register_argc_argv = Off +;register_argc_argv = Off ; When enabled, the ENV, REQUEST and SERVER variables are created when they're ; first used (Just In Time) instead of when the script starts. If these diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt index 03fccaa9b704d..4043e8b6ec7d0 100644 --- a/tests/basic/011.phpt +++ b/tests/basic/011.phpt @@ -1,5 +1,9 @@ --TEST-- Testing $argc and $argv handling (GET) +--SKIPIF-- + --INI-- register_argc_argv=1 --GET-- diff --git a/tests/basic/011_windows.phpt b/tests/basic/011_windows.phpt new file mode 100644 index 0000000000000..fd359fe4032af --- /dev/null +++ b/tests/basic/011_windows.phpt @@ -0,0 +1,22 @@ +--TEST-- +Testing $argc and $argv handling (GET) +--INI-- +register_argc_argv=1 +--GET-- +foo=ab+cd+ef+123+test +--FILE-- + +--EXPECT-- +0: foo=ab +1: cd +2: ef +3: 123 +4: test