From dbb28641e2d0e5158e1ac66c8ade4533cf7fcab5 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 16 Feb 2026 11:16:22 +0000 Subject: [PATCH 1/4] ext/session: pack boolean globals This reduces the size of the global struct from 448 bytes to 432 bytes --- ext/session/php_session.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/session/php_session.h b/ext/session/php_session.h index ae5fa154bae6..7f93c5cec593 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -133,10 +133,19 @@ typedef struct _php_ps_globals { bool cookie_secure; bool cookie_httponly; bool cookie_partitioned; + bool use_cookies; + bool use_only_cookies; + bool send_cookie; + bool auto_start; + bool define_sid; const ps_module *mod; const ps_module *default_mod; void *mod_data; php_session_status session_status; + bool use_strict_mode; /* whether or not PHP accepts unknown session ids */ + bool lazy_write; /* omit session write when it is possible */ + bool in_save_handler; /* state if session is in save handler or not */ + 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; @@ -157,15 +166,8 @@ typedef struct _php_ps_globals { zval ps_validate_sid; zval ps_update_timestamp; } mod_user_names; - bool mod_user_implemented; - bool mod_user_is_open; - bool auto_start; - bool use_cookies; - bool use_only_cookies; - bool use_trans_sid; /* contains the INI value of whether to use trans-sid */ - bool send_cookie; - bool define_sid; + zend_string *session_vars; /* serialized original session data */ const struct ps_serializer_struct *serializer; zval http_session_vars; @@ -180,11 +182,9 @@ typedef struct _php_ps_globals { bool rfc1867_enabled; /* session.upload_progress.enabled */ bool rfc1867_cleanup; /* session.upload_progress.cleanup */ - bool use_strict_mode; /* whether or not PHP accepts unknown session ids */ - bool lazy_write; /* omit session write when it is possible */ - bool in_save_handler; /* state if session is in save handler or not */ - bool set_handler; /* state if session module i setting handler or not */ - zend_string *session_vars; /* serialized original session data */ + bool mod_user_implemented; + bool mod_user_is_open; + bool use_trans_sid; /* contains the INI value of whether to use trans-sid */ } php_ps_globals; typedef php_ps_globals zend_ps_globals; From 99bf26be0b81a08f2fef4f96f8983075c81eacae Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 16 Feb 2026 11:23:55 +0000 Subject: [PATCH 2/4] ext/session: add mod_user_uses_object_methods_as_handlers global This solves the use case of knowing if the session handlers are methods of an object or individual handlers without relying on the now removed mod_user_names global. --- UPGRADING.INTERNALS | 3 +++ ext/session/php_session.h | 1 + ext/session/session.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 0c8e10e17f08..fc672ac54a82 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -106,6 +106,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES - ext/session: . php_session_flush() now returns a bool rather than a zend_result. + . The mod_user_names global has been removed. + . The mod_user_uses_object_methods_as_handlers global has been added, + it indicates whether the session handlers are methods of an object or not. . Removed session_adapt_url(). . PS_OPEN_ARGS is now defined as `void **mod_data, zend_string *save_path, zend_string *session_name` diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 7f93c5cec593..b7ed88a8f6c7 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -184,6 +184,7 @@ typedef struct _php_ps_globals { bool mod_user_implemented; bool mod_user_is_open; + bool mod_user_uses_object_methods_as_handlers; bool use_trans_sid; /* contains the INI value of whether to use trans-sid */ } php_ps_globals; diff --git a/ext/session/session.c b/ext/session/session.c index 5a05700608cc..02977d8d6115 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -118,6 +118,7 @@ static inline void php_rinit_session_globals(void) PS(set_handler) = false; PS(mod_data) = NULL; PS(mod_user_is_open) = false; + PS(mod_user_uses_object_methods_as_handlers) = false; PS(define_sid) = true; PS(session_vars) = NULL; PS(module_number) = my_module_number; @@ -2123,6 +2124,7 @@ PHP_FUNCTION(session_set_save_handler) zend_string_release_ex(validate_sid_name, false); zend_string_release_ex(update_timestamp_name, false); + PS(mod_user_uses_object_methods_as_handlers) = true; if (register_shutdown) { /* create shutdown function */ php_shutdown_function_entry shutdown_function_entry = { @@ -2214,6 +2216,7 @@ PHP_FUNCTION(session_set_save_handler) SESSION_SET_USER_HANDLER_PROCEDURAL_OPTIONAL(ps_validate_sid, validate_id_fci); SESSION_SET_USER_HANDLER_PROCEDURAL_OPTIONAL(ps_update_timestamp, update_timestamp_fci); + PS(mod_user_uses_object_methods_as_handlers) = false; RETURN_TRUE; } @@ -2843,6 +2846,7 @@ static PHP_GINIT_FUNCTION(ps) ps_globals->default_mod = NULL; ps_globals->mod_user_implemented = false; ps_globals->mod_user_is_open = false; + ps_globals->mod_user_uses_object_methods_as_handlers = false; ps_globals->session_vars = NULL; ps_globals->set_handler = false; ps_globals->session_started_filename = NULL; From b3c259c13c9d0fa9014ca59adcbdd09212bed670 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 16 Feb 2026 17:49:37 +0000 Subject: [PATCH 3/4] Revert "ext/posix: validate permissions argument in posix_mkfifo()" This reverts commit 6bd97e72b719599b3110fd5ec543b2996f52ba63. --- NEWS | 2 -- ext/posix/posix.c | 5 --- .../tests/posix_mkfifo_invalid_mode.phpt | 36 ------------------- 3 files changed, 43 deletions(-) delete mode 100644 ext/posix/tests/posix_mkfifo_invalid_mode.phpt diff --git a/NEWS b/NEWS index e6688bb6791b..dae787ab53f8 100644 --- a/NEWS +++ b/NEWS @@ -80,8 +80,6 @@ PHP NEWS - Posix: . Added validity check to the flags argument for posix_access(). (arshidkv12) - . Added validity check to the permissions argument for posix_mkfifo(). - (arshidkv12) - Reflection: . Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true diff --git a/ext/posix/posix.c b/ext/posix/posix.c index a81372349fd4..76e14f6ecb0c 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -621,11 +621,6 @@ PHP_FUNCTION(posix_mkfifo) RETURN_FALSE; } - if (mode < 0 || (mode & ~07777)) { - zend_argument_value_error(2, "must be between 0 and 0o7777"); - RETURN_THROWS(); - } - result = mkfifo(ZSTR_VAL(path), mode); if (result < 0) { POSIX_G(last_error) = errno; diff --git a/ext/posix/tests/posix_mkfifo_invalid_mode.phpt b/ext/posix/tests/posix_mkfifo_invalid_mode.phpt deleted file mode 100644 index 5c9f251adfca..000000000000 --- a/ext/posix/tests/posix_mkfifo_invalid_mode.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -posix_mkfifo(): invalid mode argument ---SKIPIF-- - ---FILE-- -getMessage(), "\n"; -} - -// Too large mode -try { - posix_mkfifo(__DIR__ . "/testfifo2", 010000); // > 07777 -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} - -// Garbage bits -try { - posix_mkfifo(__DIR__ . "/testfifo3", 020000); // S_IFCHR bit -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; -} -?> ---EXPECTF-- -posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777 -posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777 -posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777 From 84bfe2fadda9e2a072d136c60ce5923b8967df31 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:22:03 +0100 Subject: [PATCH 4/4] Update EXTENSIONS to reflect reality Not very interested in doing active development on these components anymore, I'll be around to fix critical issues however. --- EXTENSIONS | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/EXTENSIONS b/EXTENSIONS index 396974d3c1fe..e1eee3c0239c 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -170,57 +170,57 @@ EXTENSION: dom PRIMARY MAINTAINER: Christian Stocker (2003 - 2011) Rob Richards (2003 - 2012) Marcus Börger (2003 - 2006) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- EXTENSION: simplexml PRIMARY MAINTAINER: Marcus Börger (2003 - 2008) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- EXTENSION: soap PRIMARY MAINTAINER: Dmitry Stogov (2004 - 2018) - Niels Dossche (2024 - 2025) + Nora Dossche (2024 - 2026) MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xml PRIMARY MAINTAINER: Thies C. Arntzen (1999 - 2002) Rob Richards (2003 - 2013) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: libxml PRIMARY MAINTAINER: Rob Richards (2003 - 2009) Christian Stocker (2004 - 2011) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xmlreader PRIMARY MAINTAINER: Rob Richards (2004 - 2010) Christian Stocker (2004 - 2004) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xmlwriter PRIMARY MAINTAINER: Rob Richards (2004 - 2010) Pierre-Alain Joye (2005-2009) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xsl PRIMARY MAINTAINER: Christian Stocker (2003 - 2011) Rob Richards (2003 - 2010) - Niels Dossche (2023 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2023 - 2026) +MAINTENANCE: Odd fixes STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- @@ -486,8 +486,8 @@ EXTENSION: tidy PRIMARY MAINTAINER: John Coggeshall (2003 - 2006) Ilia Alshanetsky (2003 - 2009) Nuno Lopes (2006 - 2012) - Niels Dossche (2025 - 2025) -MAINTENANCE: Maintained + Nora Dossche (2025 - 2026) +MAINTENANCE: Odd fixes STATUS: Working ------------------------------------------------------------------------------- EXTENSION: tokenizer