[php-src] PR #25252: Fix GH-25249: Fibers start with error_reporting = 0 when the directive is unset
| From: | rafamolina1 | Date: | Fri, 06 Nov 2026 20:28:00 +0000 |
| Subject: | [php-src] PR #25252: Fix GH-25249: Fibers start with error_reporting = 0 when the directive is unset | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40364@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25252
Author: rafamolina1
## Summary
- When
error_reporting is unset, OnUpdateErrorReporting() stores
E_ALL in EG(error_reporting), but the INI value stays NULL.
zend_fiber_execute() reads that entry with zend_ini_long(), gets
0, and the fiber drops warnings. This is what php -n and the official
images without a php.ini do. GH-23930 removed the old E_ALL fallback.
- Restore the fallback only when zend_ini_str_ex() returns NULL.
zend_ini_str() cannot be used here: it turns that NULL into an empty
string. An explicit 0 or an empty value stays 0.
- The fiber still reads the INI entry rather than EG(error_reporting), so the
@ operator outside the fiber does not leak in.
Fixes GH-25249.
## Test plan
- [x] Zend/tests/fibers/gh25249.phpt runs a child with php -n and expects
30719 plus both undefined-variable warnings
- [x] gh23921.phpt and
silence-operator-outside-fiber-should-no-widen-error-reporting.phpt pass
- [x] Zend/tests/fibers passes (121 passed, 2 skipped for missing pcntl
and posix)
- [x] The same three tests pass with opcache.jit=function and
opcache.jit=tracing
- [x] php -n prints 30719 in the main script and in the fiber; -d
error_reporting=0 and an empty directive stay 0
- [x] ASAN, debug, and ZTS: Zend/tests/fibers passes (118 passed, 5 skipped)