Skip to content

Language: throw expressions — JIT lowering (phase 2 of #3802) - #7324

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-4137-throw-expression-jit
Jun 7, 2026
Merged

Language: throw expressions — JIT lowering (phase 2 of #3802)#7324
PurHur merged 1 commit into
masterfrom
agent/issue-4137-throw-expression-jit

Conversation

@PurHur

@PurHur PurHur commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Closes #4137

Summary

php-src reference

  • Zend/zend_compile.czend_compile_throw in expression context
  • Zend/zend_ast.cZEND_AST_THROW

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/jit.php -r "try { echo (false ? 1 : throw new LogicException(\"x\")); } catch (LogicException \$e) { echo \$e->getMessage(); }"'
# x

php vendor/bin/phpunit --filter throw_expression
# OK (6 tests)

Output:

x
OK (6 tests, 6 assertions)

Made with Cursor

Stop deferring MCJIT when TYPE_TRY/CATCH/THROW appear at script scope now that
TryCatchHelper lowers them; repair Type::never() overlay for Expr_Throw typing
and add throw_expression.phpt to TryCatchJITTest.

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

Development

Successfully merging this pull request may close these issues.

Language: throw expressions — JIT lowering (phase 2 of #3802)

1 participant