Fix syntax error in the headers_with_mbstring.phpt skip condition - #36
Merged
Merged
Conversation
die requires parentheses when given a value, so the skip branch was a parse error. run-tests treats a --SKIPIF-- that fails to parse as "do not skip", meaning that on a build without ext/mbstring the test would run against the non-mbstring encoder and fail with an unrelated diff instead of skipping. Invisible so far because every job in the CI matrix has ext/mbstring, so the branch never executed. headers_without_mbstring.phpt already uses the parenthesised form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello again,
The skip condition in
tests/headers_with_mbstring.phptis a parse error, so the test can never skip. It has stayed invisible because every job in the CI matrix has ext/mbstring, so the branch never executes. The sibling filetests/headers_without_mbstring.phptalready uses the parenthesised form.Why it is a parse error
exit/dieaccept an argument only in parentheses, sodie;anddie("x");are valid whiledie "x";is not. That has been true for the whole range this package supports (composer.jsonrequires>=5.2.0), through two different parser implementations.Checked against PHP 8.5:
Sources
Zend/zend_language_parser.y(PHP-5.6): theexit_exprruleZend/zend_language_parser.y(master):T_EXIT ctor_arguments,ctor_arguments,argument_listFix
AI use disclosure
Anthropic's Claude LLM with Opus 5 found the bug and wrote the detailed explanation.