Skip to content

Fix highlight_string Zend 8.4 HTML and assert() warning parity (#23733, #23731) - #23767

Merged
PurHur merged 1 commit into
masterfrom
fix/highlight-assert-parity
Jul 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/highlight-assert-parity

Conversation

@PurHur

@PurHur PurHur commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

Verification

# highlight_string byte-match vs php:8.4-cli
php bin/vm.php -r 'echo highlight_string("<?php echo 1;", true), "\n";'
docker run --rm -i --entrypoint php php:8.4-cli -r 'echo highlight_string("<?php echo 1;", true), "\n";'
# → identical output

# assert warning repro
php bin/vm.php -r 'ini_set("zend.assertions","1"); ini_set("assert.exception","0"); error_reporting(E_ALL); set_error_handler(fn($n,$s)=>print("W:$n:$s\n")?:true); assert(false,"x");'
# → W:2:assert(): x failed

./script/phpunit.sh --filter 'highlight_string_pre_wrapper|assert_warning_parity|highlight_file_multiline_br|highlight_file_br'
# → OK (8 tests, 8 assertions)

Closes #23733
Closes #23731

Made with Cursor

Match php-src highlight.c <pre><code> wrapper with literal spaces instead of nbsp/br, and emit E_WARNING with assert(): … failed for failing assertions when assert.exception=0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant