Language: include() syntax errors throw catchable ParseError (#32154) - #32162
Merged
Merged
Conversation
ZEND_INCLUDE_OR_EVAL compile failures are ParseError in the caller, not a process-fatal parseAndCompile dump. Route VM and JIT include targets through VmInclude PHP SSOT with no new C runtime logic. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
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.
Summary
include/requireof a syntax-error file now throws a catchableParseErrorinto the caller (try/catch (Throwable)), matching php-srcZEND_INCLUDE_OR_EVAL/zend_compile_file.VmIncludePHP SSOT.parseAndCompileFile(..., forIncludeTarget: true)no longer dumpsparseAndCompile failure/PhpParser\/bundle_snippeton stderr.runtime/*.clogic (C runtime lines removed: none; this is a PHP-only path).php-src:
Zend/zend_execute.c(ZEND_INCLUDE_OR_EVAL),Zend/zend_compile.c(zend_compile_file).PHP:
lib/VM/VmInclude.php,lib/VM.php,lib/Runtime.php,lib/JIT/IncludeHelper.php.Closes #32154
Test plan
IncludeParseError32154VMTest/JITTestVmIncludeTest+IncludeHelperShrinkTest+IncludeInheritsThis*Verification
(php-parser token text
T_LNUMBERis the equivalent of Zendinteger "2".)Not covered: full
VMTest/JITTestsuites; AOTphpc buildof this repro;ci-fast.sh.Made with Cursor