Hi!
On 23/12/2025 11:06, Sergei Issaev wrote:
which compiles to:
```
<?php echo htmlspecialchars($expr, ENT_QUOTES | ENT_SUBSTITUTE |
ENT_HTML5, 'UTF-8'); ?>
```
htmlspecialchars is configurable for a reason and your flags are
arbitrarily different from the function default
- Syntax is currently a parse error → no BC break.
It's not, you forgot about short_open_tag=1, in which case it's
interpreted as <? (~$expr) ?>
I basically see no value over
// included earlier
function h($s)
{
return htmlspecialchars($s, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
// template
<?= h($user_input) ?>
It's short, it does what you want, it's available today
--
Anton