You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under declare(strict_types=1), file_get_contents($filename, null) must TypeError because $use_include_path is typed bool. VM soft-nulls via VmMath::parseBoolBuiltinArg (non-ForFrame), emits E_DEPRECATED, and still reads the file.
Repro
Zend 8.2.32 (2026-08-15)
VM (2026-08-15)
file_get_contents(__FILE__, null)
TypeError: … Argument #2 ($use_include_path) must be of type bool, null given
Category
stdlib· php-src-strictProblem
Under
declare(strict_types=1),file_get_contents($filename, null)mustTypeErrorbecause$use_include_pathis typedbool. VM soft-nulls viaVmMath::parseBoolBuiltinArg(non-ForFrame), emitsE_DEPRECATED, and still reads the file.file_get_contents(__FILE__, null)TypeError: … Argument #2 ($use_include_path) must be of type bool, null givenDeprecated+ successful readphp-src reference
ext/standard/file.c—PHP_FUNCTION(file_get_contents)(Z_PARAM_BOOLuse_include_path)ext/standard/file.stub.php—file_get_contents(string $filename, bool $use_include_path = false, …)PHP implementation target
ext/standard/file_get_contents.php— switchparseBoolBuiltinArg→parseBoolBuiltinArgForFramefor arg Php stdlib specs implementation #2 so callerstrict_typesTypeErrors on null (same pattern as microtime/hrtime peers)JitFileGetContents/ bool arg lowering — same guardRepro
Done when
$use_include_pathunder strict_types → ZendTypeError; omit-arg still false; non-strict may soft-null DEP like Zend.phptundertest/compliance/cases/stdlib/