You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Language: negative bit shift ArithmeticError bypasses try/catch (Zend/zend_operators.c) #21912
bug · php-src-strict · language / operators / exceptions
Problem
Zend throws a catchableArithmeticError: Bit shift by negative number for << / >> with a negative shift count. php-compiler raises the same ArithmeticError from lib/VM/Variable.php but it escapes user try/catch and becomes an uncaught fatal (engine abort), so scripts cannot handle the error.
Exception dispatch must go through the VM user-exception path (same as division-by-zero / modulo-by-zero, which are catchable today)
PHP implementation target
lib/VM/Variable.php (_bitwiseOp / bitwiseOp) — throw via VM exception mechanism so try/catch works; do not throw a raw PHP exception that bypasses the interpreter frame
cleanup: deleted stale remote branch agent/issue-21912-negative-bit-shift-catchable (work landed via squash merge in #21917; tip was not an ancestor of master but issue is closed and there is no open PR — leftover post-merge agent branch).
Activity
PurHur commentedon Jul 21, 2026
claim: Lane A implementer — starting this run
Gate snapshot (pre-work):
Language: make negative << / >> catchable ArithmeticError (#21912) (#…
PurHur commentedon Jul 21, 2026
Merged via #21917
Verification
1 << -1/1 >> -1catchable asArithmeticError: Bit shift by negative number; script continues (afterprints)./script/phpunit.sh --filter 'JitOperandHelpersRuntimeShrinkTest|negative_bit_shift'→ OK 18/18shift_bool|shift_float|assignop_shift) → OK 15/15Gate snapshot (this run, before claim)
bootstrap-inventory --check: OK 6326/6326release-readiness --json:user_release_ready=yes(inventory, spine-coverage, root-readme-sync, north-star5-fast, vm-driver-probe all ok)PurHur commentedon Jul 22, 2026
cleanup: deleted stale remote branch
agent/issue-21912-negative-bit-shift-catchable(work landed via squash merge in #21917; tip was not an ancestor ofmasterbut issue is closed and there is no open PR — leftover post-merge agent branch).