Category
stdlib · php-src-strict
Problem
php-src names the first parameter of file_get_contents() filename. Zend accepts:
file_get_contents(filename: 'php://memory'); // string (possibly empty)
VM rejects with Unknown named parameter $filename. Positional file_get_contents('php://memory') works.
Distinct from #9308 (offset/length slice semantics — verified green on master 2026-06-19).
php-src reference
Repro (failure today)
<?php
var_export(file_get_contents(filename: 'php://memory'));
echo "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php
# VM: Unknown named parameter $filename
'
| Call |
Zend PHP 8.2+ |
VM today |
file_get_contents(filename: 'php://memory') |
'' |
fatal ❌ |
| positional |
'' |
'' ✅ |
Scope (this repo)
| Path |
Work |
lib/BuiltinParamNames.php / patches |
Register filename + optional arg names |
lib/Compiler.php, lib/VM/NamedArgs.php, lib/JIT/NamedArgs.php |
Named binding |
ext/standard/file_get_contents.php |
handler after wiring |
| Tests |
test/compliance/cases/stdlib/file_get_contents_filename_named.phpt |
PHP-in-PHP first — no new runtime/*.c.
Done when
Related
Category
stdlib· php-src-strictProblem
php-src names the first parameter of
file_get_contents()filename. Zend accepts:VM rejects with
Unknown named parameter $filename. Positionalfile_get_contents('php://memory')works.Distinct from #9308 (offset/length slice semantics — verified green on master 2026-06-19).
php-src reference
ext/standard/file.c—PHP_FUNCTION(file_get_contents)ext/standard/basic_functions.stub.php—filename,use_include_path,context,offset,lengthZend/zend_compile.cRepro (failure today)
file_get_contents(filename: 'php://memory')''''''✅Scope (this repo)
lib/BuiltinParamNames.php/ patchesfilename+ optional arg nameslib/Compiler.php,lib/VM/NamedArgs.php,lib/JIT/NamedArgs.phpext/standard/file_get_contents.phptest/compliance/cases/stdlib/file_get_contents_filename_named.phptPHP-in-PHP first — no new
runtime/*.c.Done when
context:/offset:/length:bind to correct slots when added in follow-up./script/ci-fast.sh --filter file_get_contents_filename_namedgreenRelated