Commit c5ea0eb18bb for php.net

commit c5ea0eb18bbceb2a7a36adc5213a36c02ca4e71e
Merge: 1e89e47376d a80216b291c
Author: Gina Peter Banyard <girgias@php.net>
Date:   Thu Jul 2 11:54:45 2026 +0100

    Merge branch 'PHP-8.4' into PHP-8.5

    * PHP-8.4:
      Update NEWS for bugfixes
      ext/dba: fix oob read on malformed length field in dba flatfile handler
      ext/exif: Fix GH-11020: spurious "Illegal IFD size" warning in exif_read_data()
      ext/session: fix GH-21314 (session GC behaviour is different since 8.4)

diff --cc NEWS
index 7cabb876d20,6ac3e8db393..fceef3f9a3c
--- a/NEWS
+++ b/NEWS
@@@ -1,13 -1,14 +1,20 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? ????, PHP 8.4.24
 +?? ??? ????, PHP 8.5.9
 +
 +- Core:
 +  . Fixed bug GH-22290 (AST pretty printing does not correctly handle strings
 +    containing NUL). (iliaal)
 +  . Fixed bug GH-22206 (missing return in global register detection).
 +    (P3p111n0)

+ - DBA:
+   . Fixed OOB read on malformed length field in dba flatfile handler. (alhudz)
+
+ - Exif:
+   . Fixed bug GH-11020 (exif_read_data() emits a spurious "Illegal IFD size"
+     warning when an IFD is not followed by a next-IFD offset). (Eyüp Can Akman)
+
  - Hash:
    . Fixed bug GH-18173 (ext/hash relies on implementation-defined malloc
      alignment). (iliaal)
@@@ -55,8 -45,12 +62,12 @@@
    . Fixed bug GH-22441 (ReflectionClass::hasProperty() and getProperty() ignore
      dynamic properties shadowing a private parent property). (iliaal)

+ - Session:
+   . Fixed bug GH-21314 (Different session garbage collector behavior between
+     PHP 8.3 and PHP 8.5). (jorgsowa)
+
  - SPL:
 -  . Fix class_parents for classes with leading slash in non-autoload mode.
 +  . Fix	class_parents for classes with leading slash in non-autoload mode.
      (jorgsowa)
    . Ignore leading back-slash in class_parents(), class_implements(), and
      class_uses(). (jorgsowa)
diff --cc ext/session/session.c
index 489f82d6f14,ba71d709a53..c4f9e878115
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@@ -404,8 -393,19 +404,20 @@@ static zend_long php_session_gc(bool im

  	/* GC must be done before reading session data. */
  	if ((PS(mod_data) || PS(mod_user_implemented))) {
 +		/* Use probability-based GC if not forced and probability is configured */
  		if (!collect && PS(gc_probability) > 0) {
+ 			/* Seed lazily on first GC draw per process. */
+ 			if (UNEXPECTED(!PS(random_seeded))) {
+ 				php_random_uint128_t seed;
+ 				if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) {
+ 					seed = php_random_uint128_constant(
+ 						php_random_generate_fallback_seed(),
+ 						php_random_generate_fallback_seed()
+ 					);
+ 				}
+ 				php_random_pcgoneseq128xslrr64_seed128(PS(random).state, seed);
+ 				PS(random_seeded) = true;
+ 			}
  			collect = php_random_range(PS(random), 0, PS(gc_divisor) - 1) < PS(gc_probability);
  		}

@@@ -2946,19 -2996,13 +2958,12 @@@ static PHP_GINIT_FUNCTION(ps
  		.algo = &php_random_algo_pcgoneseq128xslrr64,
  		.state = &ps_globals->random_state,
  	};
- 	php_random_uint128_t seed;
- 	if (php_random_bytes_silent(&seed, sizeof(seed)) == FAILURE) {
- 		seed = php_random_uint128_constant(
- 			php_random_generate_fallback_seed(),
- 			php_random_generate_fallback_seed()
- 		);
- 	}
- 	php_random_pcgoneseq128xslrr64_seed128(ps_globals->random.state, seed);
+ 	ps_globals->random_seeded = false;
  }
 -/* }}} */

 -static PHP_MINIT_FUNCTION(session) /* {{{ */
 +static PHP_MINIT_FUNCTION(session)
  {
 -	zend_register_auto_global(zend_string_init_interned("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL);
 +	zend_register_auto_global(zend_string_init_interned(ZEND_STRL("_SESSION"), true), false, NULL);

  	my_module_number = module_number;
  	PS(module_number) = module_number;