[php-src] Issue #21314: Different session garbage collector behavior between PHP 8.3 and PHP 8.5
| From: | sebastien-jj | Date: | Fri, 27 Feb 2026 09:35:35 +0000 |
| Subject: | [php-src] Issue #21314: Different session garbage collector behavior between PHP 8.3 and PHP 8.5 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251730@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/21314
Author: sebastien-jj
### Description
**Description**
Hello,
We are observing a difference in the behavior of the file-based session garbage collector between
PHP 8.3 and PHP 8.5, using the exact same configuration.
We are not sure whether the current behavior is expected or if this could indicate a regression, so
we are seeking clarification.
**Configuration (identical on both versions)**
```
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
```
**Observed Behavior**
Under PHP 8.3 :
The number of session files in the storage directory stabilized around ~10,000 files.
Under PHP 8.5 :
The number of session files can grow to 120,000+.
Expired sessions appear to be cleaned much less frequently.
Traffic level and server environment are same.
**Questions**
Has there been any change in the session GC trigger logic between PHP 8.3 and PHP 8.5?
Has the probabilistic calculation (gc_probability / gc_divisor) changed?
Is there any documented change regarding file-based session handling?
### PHP Version
```plain
PHP 8.5.3
```
### Operating System
_No response_