Summary
html_entity_decode() leaves numeric character references (A, A) unchanged. Zend decodes them to the corresponding UTF-8 character (A). Named-entity gaps are tracked separately (#10763, #10519); this issue is decimal/hex numeric refs only.
php-src reference: ext/standard/html.c (php_unescape_html_entities, numeric entity branch).
PHP implementation target: ext/standard/ HTML helpers (VmHtml / string builtins) — port decode table logic in PHP; no permanent C-only shortcut in runtime/.
Repro
./script/docker-exec.sh -- php test/repro/issue_html_entity_decode_numeric.php # Zend: A / A
./script/docker-exec.sh -- php bin/vm.php test/repro/issue_html_entity_decode_numeric.php # VM: A / A
Minimal:
html_entity_decode('A', ENT_QUOTES | ENT_HTML5); // Zend: 'A'; VM: 'A'
html_entity_decode('A', ENT_QUOTES | ENT_HTML5); // Zend: 'A'; VM: 'A'
Expected (php-src-strict)
- Decimal
&#digits; and hex &#xhex; / &#Xhex; decode to UTF-8 bytes.
- Invalid/out-of-range numeric refs follow Zend (typically leave ref or emit warning per php-src).
- Works with combined
ENT_* flag ints when those flags are accepted.
Done when
test/repro/issue_html_entity_decode_numeric.php green on php bin/vm.php.
- Targeted compliance guard under
test/compliance/ or test/repro/.
Summary
html_entity_decode()leaves numeric character references (A,A) unchanged. Zend decodes them to the corresponding UTF-8 character (A). Named-entity gaps are tracked separately (#10763, #10519); this issue is decimal/hex numeric refs only.php-src reference:
ext/standard/html.c(php_unescape_html_entities, numeric entity branch).PHP implementation target:
ext/standard/HTML helpers (VmHtml/ string builtins) — port decode table logic in PHP; no permanent C-only shortcut inruntime/.Repro
Minimal:
Expected (php-src-strict)
&#digits;and hex&#xhex;/&#Xhex;decode to UTF-8 bytes.ENT_*flag ints when those flags are accepted.Done when
test/repro/issue_html_entity_decode_numeric.phpgreen onphp bin/vm.php.test/compliance/ortest/repro/.