Skip to content

Regression: htmlspecialchars_decode/html_entity_decode Reflection names quote_style — Zend flags; named args rejected (ext/standard/basic_functions.stub.php) #23265

Description

@PurHur

Category

bug · php-src-strict · named arguments / Reflection

Problem

HTML entity decode helpers still advertise legacy quote_style instead of Zend stub flags, so flags: named calls fail (and $string also fails when paired). Positional calls match. Probed 2026-07-26 vs host Zend 8.2.32.

Repro Zend 8.2 VM (2026-07-26)
Reflection htmlspecialchars_decode string,flags string,quote_style
Reflection html_entity_decode string,flags,encoding string,quote_style,encoding
htmlspecialchars_decode(string: "&", flags: ENT_QUOTES) "&" Unknown named parameter $string (or $flags if string positional)
html_entity_decode(string: "&", flags: ENT_QUOTES) "&" Unknown named parameter $string

php-src reference

PHP implementation target

  • lib/BuiltinParamNames.php — rename quote_styleflags for both
  • Reflection + named-arg dispatch; PHP-in-PHP only; no new C

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''$r=new ReflectionFunction("htmlspecialchars_decode"); foreach($r->getParameters() as $p) echo $p->getName(), "\n"; try { echo htmlspecialchars_decode("&", flags: ENT_QUOTES), "\n"; } catch (Throwable $e) { echo $e->getMessage(), "\n"; }'\'''

Done when

  • Reflection second param is flags (not quote_style) for both functions
  • Zend-style named calls (string / flags / encoding) match Zend on VM
  • Compliance .phpt + test/repro/issue_NNNN_*.php
  • php-src-strict; no php-compiler-strict shortcut

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions