Category
stdlib · php-src-strict
Problem
Filtered stream pipelines in php-src use stream_bucket_make_writeable(), stream_bucket_append(), and stream_bucket_new() to move buckets between brigades. User-defined php://filter chains and custom filters call these after #3494 / stream filters land.
This compiler implements core fopen/fread/fwrite but not the bucket API — function_exists('stream_bucket_make_writeable') is false on VM.
php-src reference
Repro A — existence
<?php
var_export(function_exists('stream_bucket_make_writeable'));
var_export(function_exists('stream_bucket_append'));
var_export(function_exists('stream_bucket_new'));
echo "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro_stream_bucket_exists.php # true,true,true
php bin/vm.php repro_stream_bucket_exists.php # false,false,false
'
Repro B — brigade mutation (after filters exist)
Port minimal php-src test: read via php://filter/read=string.toupper and inspect bucket objects when filter callbacks invoke bucket helpers (depends on #9047 stream_filter_* — can stub VM-only first).
Scope (this repo)
| Layer |
Path |
| VM stream layer |
lib/VM/ stream wrappers + brigade objects |
| Builtins |
ext/standard/stream_bucket_make_writeable.php, stream_bucket_append.php, stream_bucket_new.php, Module.php |
| PHP-in-PHP |
bucket structs as PHP classes, not runtime/*.c tables |
| JIT |
defer (VM-first); file follow-up if LLVM stream path needs buckets |
| Tests |
test/compliance/cases/stdlib/stream_bucket_*.phpt |
Done when
Links
Category
stdlib· php-src-strictProblem
Filtered stream pipelines in php-src use
stream_bucket_make_writeable(),stream_bucket_append(), andstream_bucket_new()to move buckets between brigades. User-definedphp://filterchains and custom filters call these after #3494 / stream filters land.This compiler implements core
fopen/fread/fwritebut not the bucket API —function_exists('stream_bucket_make_writeable')is false on VM.php-src reference
ext/standard/streamsfuncs.c—PHP_FUNCTION(stream_bucket_make_writeable),stream_bucket_append,stream_bucket_newmain/streams/php_stream_filter.c— brigade/bucket lifecycleext/standard/tests/streams/stream_bucket_*.phptRepro A — existence
Repro B — brigade mutation (after filters exist)
Port minimal php-src test: read via
php://filter/read=string.toupperand inspect bucket objects when filter callbacks invoke bucket helpers (depends on #9047 stream_filter_* — can stub VM-only first).Scope (this repo)
lib/VM/stream wrappers + brigade objectsext/standard/stream_bucket_make_writeable.php,stream_bucket_append.php,stream_bucket_new.php,Module.phpruntime/*.ctablestest/compliance/cases/stdlib/stream_bucket_*.phptDone when
function_existstrue on VMstream_bucket_make_writeable($brigade)returns bucket object orfalselike Zendstream_bucket_append($brigade, $bucket)mutates brigade; refcount semantics per php-srcscript/capability-matrix.phpregeneratedLinks