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
{{ message }}
Repository navigation
Regression: filter_var() inline options array — filter operand not int (ext/filter/filter.c) #12007
filter_var() with three arguments where the third is an inline array literal mis-binds call operands on the VM: argument #2 ($filter) is not an integer at runtime, so the builtin throws LogicException: filter must be an integer instead of validating.
Two-argument calls with FILTER_* constants work; assigning the options array to a variable first also works. The bug is specific to compiled call sites that pass a literal ['options' => …] or ['flags' => …] as the third parameter.
Root cause:matchInlineCallArgProducer mapped producers by index when ConstFetch + nested Array_ chain matched arg count; inner array was sent as $filter.
Fix:splitLeadingConstFetchWithNestedArrayLiteralChain() maps leading constant to filter arg and outer array to options.
Verification (VM):
test/repro/maintainer_gap_filter_validate_regexp_options.php → ok
test/repro/maintainer_gap_filter_var_int_null_on_failure.php → ok
Activity
PurHur commentedon Jun 26, 2026
claim: PHP Compiler STD Lib — batch (issues #12007, #12008, #12009)
PurHur commentedon Jun 26, 2026
Merged via #12014.
Root cause:
matchInlineCallArgProducermapped producers by index whenConstFetch+ nestedArray_chain matched arg count; inner array was sent as$filter.Fix:
splitLeadingConstFetchWithNestedArrayLiteralChain()maps leading constant to filter arg and outer array to options.Verification (VM):
test/repro/maintainer_gap_filter_validate_regexp_options.php→ oktest/repro/maintainer_gap_filter_var_int_null_on_failure.php→ oktest/compliance/cases/stdlib/filter_validate_regexp.phpt→ passFix filter_var() nested inline options call-arg slot wiring (#12007) (#…