Category
stdlib
Problem
html_entity_decode() and htmlspecialchars_decode() ignore ENT_HTML5 (constant 48): HTML5 named entities such as ', , ½, and © are left unchanged. Zend decodes them when ENT_HTML5 is set in the quote-style flags.
php-src reference
Repro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cat > /tmp/ent_html5.php <<'"'"'PHP'"'"'
<?php
$flags = ENT_QUOTES | ENT_HTML5;
echo html_entity_decode("'", $flags), "\n";
echo html_entity_decode(" ", ENT_HTML5), "\n";
echo html_entity_decode("½", ENT_HTML5), "\n";
PHP
php /tmp/ent_html5.php
php bin/vm.php /tmp/ent_html5.php
'
| Input |
Zend (ENT_HTML5) |
This compiler |
' + ENT_QUOTES|ENT_HTML5 |
' |
' |
|
U+00A0 (non-breaking space) |
|
½ |
½ |
½ |
Scope (this repo)
ext/standard/VmString.php — extend htmlspecialchars_decode() / entity table lookup for HTML5 names
ext/standard/html_entity_decode.php, htmlspecialchars_decode.php — pass ENT_HTML5 flag through
- JIT/AOT paths registered alongside VM handlers
test/compliance/cases/stdlib/html_entity_decode_ent_html5.phpt
Related: #2472 (ENT_COMPAT subset); this is the HTML5 named-entity gap.
Done when
- VM + JIT + AOT: repro script output matches Zend byte-for-byte (or codepoint-normalized for
)
ENT_HTML5 without other flags follows php-src rules for which entities decode
- Compliance
.phpt under test/compliance/cases/stdlib/ compares Zend vs VM on the repro script
Category
stdlibProblem
html_entity_decode()andhtmlspecialchars_decode()ignoreENT_HTML5(constant48): HTML5 named entities such as', ,½, and©are left unchanged. Zend decodes them whenENT_HTML5is set in the quote-style flags.php-src reference
ext/standard/html.c—php_html_entities()/ENT_HTML5entity tables (ent_html5/ent_html5_apos)ext/standard/html_tables.h— HTML5 named entity mapRepro (failure today)
ENT_HTML5)'+ENT_QUOTES|ENT_HTML5'' ½½½Scope (this repo)
ext/standard/VmString.php— extendhtmlspecialchars_decode()/ entity table lookup for HTML5 namesext/standard/html_entity_decode.php,htmlspecialchars_decode.php— passENT_HTML5flag throughtest/compliance/cases/stdlib/html_entity_decode_ent_html5.phptRelated: #2472 (ENT_COMPAT subset); this is the HTML5 named-entity gap.
Done when
)ENT_HTML5without other flags follows php-src rules for which entities decode.phptundertest/compliance/cases/stdlib/compares Zend vs VM on the repro script