Category
Regression: · php-src-strict · SPL soft-null
Problem
SplFileObject::setFlags(null) under non-strict types must emit E_DEPRECATED ("Passing null to parameter #1 … of type int is deprecated") and soft-coerce to 0 (Zend). VM silently coerces to 0 with no deprecation. Sibling soft-null setters: RegexIterator (#31748), FilesystemIterator (#31722), CachingIterator (#31694).
Probed 2026-08-17 — host Zend PHP 8.2+ vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-17) |
$f->setFlags(null) then getFlags() |
E_DEPRECATED + 0 |
silent flags=0 (no DEP) |
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_splfileobject_setflags_null.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_splfileobject_setflags_null.php'
Done when
Category
Regression:· php-src-strict · SPL soft-nullProblem
SplFileObject::setFlags(null)under non-strict types must emitE_DEPRECATED("Passing null to parameter #1 … of type int is deprecated") and soft-coerce to0(Zend). VM silently coerces to0with no deprecation. Sibling soft-null setters: RegexIterator (#31748), FilesystemIterator (#31722), CachingIterator (#31694).Probed 2026-08-17 — host Zend PHP 8.2+ vs
php bin/vm.php.$f->setFlags(null)thengetFlags()E_DEPRECATED+0flags=0(no DEP)php-src reference
ext/spl/spl_directory.c—SPL_METHOD(SplFileObject, setFlags)/Z_PARAM_LONGext/spl/spl_directory.stub.php—setFlags(int $flags)PHP implementation target
ext/spl/SplFileObjectBuiltin.php—SplFileObjectSetFlags::executecurrently$frame->calledArgs[1]->resolveIndirect()->toInt(); useVmMath::parseZParamLongBuiltinArgForFramelike FilesystemIterator::setFlags (Regression: FilesystemIterator::setFlags(null) TypeError — Zend E_DEPRECATED soft coerce (ext/spl/spl_directory.c) #31722); no newruntime/*.cRepro
Done when
setFlags(null)emits Zend-matchingE_DEPRECATEDthen coerces to0on VM; JIT agrees if in scope.phptguard undertest/compliance/cases/(SPL / SplFileObject)