Category
stdlib
Problem
Zend PHP exposes stream_get_meta_data() and stream_set_blocking() for stream resource introspection and non-blocking I/O. This compiler registers related siblings (stream_get_contents, stream_set_timeout, buffer/chunk helpers) but does not register these two — user code and internal helpers that rely on them fail with Call to undefined function.
Verified 2026-06-05: Zend returns true for both function_exists() checks; VM returns false.
php-src reference
Repro
test/repro/stream_meta_blocking_missing.php:
<?php
$f = tmpfile();
var_dump(function_exists('stream_get_meta_data'));
var_dump(function_exists('stream_set_blocking'));
if (function_exists('stream_get_meta_data')) {
var_dump(is_array(stream_get_meta_data($f)));
}
fclose($f);
docker info >/dev/null
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/stream_meta_blocking_missing.php
php bin/vm.php test/repro/stream_meta_blocking_missing.php
'
| Runtime |
stream_get_meta_data |
stream_set_blocking |
| Zend PHP 8.2+ |
bool(true) + array meta |
bool(true) |
| vm.php today |
bool(false) |
bool(false) |
Scope (PHP-in-PHP)
| Path |
Work |
ext/standard/stream_get_meta_data.php |
VM builtin returning wrapper/uri/mode/seekable/etc. keys |
ext/standard/stream_set_blocking.php |
VM builtin toggling blocking on stream resources |
lib/JIT/ |
Lower both for JIT/AOT when stream resource types are known |
test/compliance/cases/stdlib/stream_get_meta_data.phpt |
Basic meta shape |
test/compliance/cases/stdlib/stream_set_blocking.phpt |
Toggle + return value |
Do not add large C tables in runtime/*.c. Reuse existing stream resource wrappers from ext/standard/stream_get_contents.php / VmFs.php where possible.
Done when
Related
Category
stdlibProblem
Zend PHP exposes
stream_get_meta_data()andstream_set_blocking()for stream resource introspection and non-blocking I/O. This compiler registers related siblings (stream_get_contents,stream_set_timeout, buffer/chunk helpers) but does not register these two — user code and internal helpers that rely on them fail withCall to undefined function.Verified 2026-06-05: Zend returns
truefor bothfunction_exists()checks; VM returnsfalse.php-src reference
ext/standard/streams.c—PHP_FUNCTION(stream_get_meta_data),PHP_FUNCTION(stream_set_blocking)main/streams/streams.c—php_stream_metadata, blocking modeRepro
test/repro/stream_meta_blocking_missing.php:stream_get_meta_datastream_set_blockingbool(true)+ array metabool(true)bool(false)bool(false)Scope (PHP-in-PHP)
ext/standard/stream_get_meta_data.phpext/standard/stream_set_blocking.phplib/JIT/test/compliance/cases/stdlib/stream_get_meta_data.phpttest/compliance/cases/stdlib/stream_set_blocking.phptDo not add large C tables in
runtime/*.c. Reuse existing stream resource wrappers fromext/standard/stream_get_contents.php/VmFs.phpwhere possible.Done when
bool(true)for bothfunction_exists()on VMstream_get_meta_data($fp)returns array with expected keys on atmpfile()handlestream_set_blocking($fp, false)returnstrueand affects subsequent reads where applicable./script/ci-fast.sh --filter stream_get_meta_datagreenRelated