Category
language · php-src-strict · IMPORTANT
Problem
PHP 8.0 throw expressions (throw in ternary/??/assignment) should compile and run on the VM path (#3802, closed). On current master, every throw-expression script fails at parseAndCompile before bytecode emission:
parseAndCompile failure: … Unknown variable op found: Expr_Throw
Root cause: ircmaxell/php-types TypeReconstructor::resolveOp() has no Expr_Throw case and throws at the tail default (prelinked/bootstrap-vendor/sources/ircmaxell/php-types/lib/PHPTypes/TypeReconstructor.php). The php-cfg / lib/Compiler.php lowering from #3802 is unreachable until PHPTypes accepts the op.
This blocks #4137 (JIT) and #4041 (AOT) — both assume VM compile already works.
php-src reference
Repro (failure today)
<?php
// ternary arm
echo (false ? 1 : throw new LogicException('x'));
// assignment (PHP 8.0+)
$x = throw new Exception('e');
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "echo (false ? 1 : throw new LogicException(\"x\"));"'
# parseAndCompile failure: Unknown variable op found: Expr_Throw
Zend PHP 8+: uncaught exception / non-zero exit (never a compile abort).
Scope (this repo)
| Layer |
Path |
Work |
| Vendor patch |
patches/php-types-*.patch, script/apply-patches.sh |
add Expr_Throw case (return never / bottom type) |
| Prelinked |
prelinked/bootstrap-vendor/ |
regenerate after patch |
| Compiler |
lib/Compiler.php |
verify compileThrowExpression still wired (#3802) |
| Tests |
test/compliance/cases/language/throw_expression*.phpt |
VM must execute before JIT work |
PHP-in-PHP first — no new runtime/*.c branches.
Done when
Related
Category
language· php-src-strict · IMPORTANTProblem
PHP 8.0 throw expressions (
throwin ternary/??/assignment) should compile and run on the VM path (#3802, closed). On currentmaster, every throw-expression script fails atparseAndCompilebefore bytecode emission:Root cause:
ircmaxell/php-typesTypeReconstructor::resolveOp()has noExpr_Throwcase and throws at the tail default (prelinked/bootstrap-vendor/sources/ircmaxell/php-types/lib/PHPTypes/TypeReconstructor.php). The php-cfg /lib/Compiler.phplowering from #3802 is unreachable until PHPTypes accepts the op.This blocks #4137 (JIT) and #4041 (AOT) — both assume VM compile already works.
php-src reference
Zend/zend_compile.c—zend_compile_throw()in expression contextZend/zend_language_parser.y—T_THROW exprRepro (failure today)
Zend PHP 8+: uncaught exception / non-zero exit (never a compile abort).
Scope (this repo)
patches/php-types-*.patch,script/apply-patches.shExpr_Throwcase (returnnever/ bottom type)prelinked/bootstrap-vendor/lib/Compiler.phpcompileThrowExpressionstill wired (#3802)test/compliance/cases/language/throw_expression*.phptPHP-in-PHP first — no new
runtime/*.cbranches.Done when
php bin/vm.php(noUnknown variable op found: Expr_Throw)??, short-circuit, and assignment throw expressions match Zend uncaught-exception behavior on VM./script/ci-fast.sh --filter throw_expressiongreen on VM groupRelated