• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KarpelesLab / goro / 26434357893

26 May 2026 05:35AM UTC coverage: 12.534% (-0.007%) from 12.541%
26434357893

push

github

MagicalTux
vm: lower $arr[k] OP= rhs and $arr[k]++ on simple-local arr natively

Add OP_ARRAY_COMPOUND_ASSIGN_LOCAL and OP_ARRAY_INC_DEC_LOCAL,
extending the existing OP_ARRAY_SET_LOCAL fast path to compound
assigns and inc/dec on simple-local array containers.

Both opcodes read the current element via arrayGet (which warns on
undef keys, matching the AST), Dup snapshot (defending against
__toString/error_handler slot-mutation during '.=' coercion), apply
compoundOp / DoInc, then write back via arraySetLocal.

Eliminates two AST-delegation call sites in emit_expr.go:
  - $local[k] OP= rhs   (was line 1139)
  - $local[k]++ / dec   (was line 1271)

Side effect: fixes a pre-existing AST panic on '$x = $a[k]++'
expr-context postfix where the snapshot+DoInc path crashed with
'SetVal() called on cached ZVal'. The VM dispatch correctly Dup's
before DoInc.

Nested containers ($obj->arr[i] OP= …, $a[i][j]++, …) still
AST-delegate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

49 of 117 new or added lines in 2 files covered. (41.88%)

43 existing lines in 4 files now uncovered.

14970 of 119433 relevant lines covered (12.53%)

2559.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.65
/core/phpv/zarray.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc