Commit 11c9b602ba8 for php

commit 11c9b602ba8861263a6067c7758a4d5f1c59790f
Author: Jorg Adam Sowa <jorg.sowa@gmail.com>
Date:   Sun Nov 22 21:42:40 2026 +0100

    ext/session: Remove module_number from session globals (#25657)

    It was a per-thread copy of the process-wide module number. Also drop
    MINIT writes to globals already set by GINIT.

diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 4b79c808463..a2f9bc7f01c 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -138,6 +138,9 @@ PHP 8.7 INTERNALS UPGRADE NOTES
   . The MYSQLND_STATS_LOCK() and MYSQLND_STATS_UNLOCK() macros were removed.
     MYSQLND_STATS_UPDATE_VALUE() is now an expression instead of a block.

+- Session:
+  . The module_number member of php_ps_globals was removed.
+
 - Standard:
   . php_explode() now takes a HashTable* instead of a zval* to store the
     resulting parts. It already expected the zval* to be IS_ARRAY.
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 2268395906d..c04c605160e 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -145,7 +145,6 @@ typedef struct _php_ps_globals {
 	bool set_handler;     /* state if session module i setting handler or not */
 	zend_string *session_started_filename;
 	uint32_t session_started_lineno;
-	int module_number;
 	php_random_status_state_pcgoneseq128xslrr64 random_state;
 	php_random_algo_with_state random;
 	zend_long gc_probability;
diff --git a/ext/session/session.c b/ext/session/session.c
index 191e350f485..a15c053fa8e 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -131,7 +131,6 @@ static inline void php_rinit_session_globals(void)
 	PS(mod_user_uses_object_methods_as_handlers) = false;
 	PS(define_sid) = true;
 	PS(session_vars) = NULL;
-	PS(module_number) = my_module_number;
 	PS(in_rfc1867_update) = false;
 	ZVAL_UNDEF(&PS(http_session_vars));
 	PS(session_started_filename) = NULL;
@@ -1705,7 +1704,7 @@ static void proposed_session_id_to_session_id(const zval *proposed_session_id) {

 PHPAPI zend_result php_session_reset_id(void)
 {
-	int module_number = PS(module_number);
+	int module_number = my_module_number;
 	zval *sid, *data, *potential_session_id;
 	bool apply_trans_sid;

@@ -3075,9 +3074,7 @@ static PHP_MINIT_FUNCTION(session)
 	zend_register_auto_global(zend_string_init_interned(ZEND_STRL("_SESSION"), true), false, NULL);

 	my_module_number = module_number;
-	PS(module_number) = module_number;

-	PS(session_status) = php_session_none;
 	REGISTER_INI_ENTRIES();

 #ifdef HAVE_LIBMM