Category
stdlib · php-src-strict
Problem
Under declare(strict_types=1), stream_filter_append($stream, null) must TypeError on string $filter_name. VM soft-coerces null→"" via VmString::coerceStringBuiltinArg, then emits unable to locate filter "" and returns false.
| Repro |
Zend 8.2.32 (2026-08-16) |
VM (2026-08-16) |
declare(strict_types=1); stream_filter_append($h, null) |
TypeError: stream_filter_append(): Argument #2 ($filter_name) must be of type string, null given |
Warning: unable to locate filter "" + false |
Distinct from closed Reflection param-name drift (#28908) and user-filter LogicException (#14001).
php-src reference
PHP implementation target
ext/standard/stream_filter_append.php / stream_filter_prepend.php (same coerce path) — use strict string guard under strict_types (InternalStrictArg / JitStringBuiltinArg peer of trim-family); JitStreamFilter / kernel helpers; no new runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_stream_filter_append_null_name.php'
# expect TypeError (match host `php test/repro/maintainer_gap_stream_filter_append_null_name.php`)
<?php
declare(strict_types=1);
$h = fopen('php://memory', 'r+');
stream_filter_append($h, null);
Done when
Category
stdlib· php-src-strictProblem
Under
declare(strict_types=1),stream_filter_append($stream, null)mustTypeErroronstring $filter_name. VM soft-coercesnull→""viaVmString::coerceStringBuiltinArg, then emitsunable to locate filter ""and returnsfalse.declare(strict_types=1); stream_filter_append($h, null)TypeError: stream_filter_append(): Argument #2 ($filter_name) must be of type string, null givenWarning: unable to locate filter ""+falseDistinct from closed Reflection param-name drift (#28908) and user-filter LogicException (#14001).
php-src reference
ext/standard/streamsfuncs.c—PHP_FUNCTION(stream_filter_append)ext/standard/basic_functions.stub.php—stream_filter_append($stream, string $filter_name, int $mode = 0, mixed $params = unknown): resourcePHP implementation target
ext/standard/stream_filter_append.php/stream_filter_prepend.php(same coerce path) — use strict string guard understrict_types(InternalStrictArg/JitStringBuiltinArgpeer of trim-family);JitStreamFilter/ kernel helpers; no newruntime/*.cRepro
Done when
strict_types, null$filter_name→TypeError: … Argument #2 ($filter_name) must be of type string, null given(VM + JIT/AOT when in scope)""/unable to locate filter ""for this casestream_filter_prependif it shares the coerce helper