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
highlight_string($code, true) and highlight_file($path, true) fatal with LogicException: highlight_string() expects bool for argument 2 when the second argument is a boolean literal (true/false). Zend accepts the call and returns an HTML string.
Summary
highlight_string($code, true)andhighlight_file($path, true)fatal withLogicException: highlight_string() expects bool for argument 2when the second argument is a boolean literal (true/false). Zend accepts the call and returns an HTML string.Repro
Zend (host/php):
This compiler (VM):
php-src reference
ext/standard/url.c—PHP_FUNCTION(highlight_string)/highlight_file$returniszend_parse_parameterstypeb(bool); literals must work.Implementation (PHP-in-PHP)
ext/standard/highlight_string.php—resolveIndirect()type check rejects bool literals passed as arg Php stdlib specs implementation #2; align with Zend coercion /Variable::TYPE_BOOLEANfor literal operands.highlight_file.php/show_sourcealias if shared path.ext/standard/JitHighlight.phpif JIT has same guard.Done when (php-src-strict)
php bin/vm.php test/repro/maintainer_gap_highlight_string_bool.phpmatches Zend output.test/compliance/or extend existing highlight tests.Related
Regression of closed #3164 / #4824 / #6486.