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

KarpelesLab / goro / 25325471162
13%

Build:
DEFAULT BRANCH: master
Ran 04 May 2026 02:44PM UTC
Jobs 1
Files 394
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 May 2026 02:42PM UTC coverage: 6.712% (+0.4%) from 6.343%
25325471162

push

github

MagicalTux
vm: native foreach (value form)

Adds OP_FOREACH_INIT, OP_FOREACH_STEP, OP_FOREACH_ADVANCE,
OP_FOREACH_UNWIND. Frame.iters holds the active iterator
stack so nested foreach works.

Coverage:
- foreach (\$src as \$v) {…}
- foreach (\$src as \$k => \$v) {…}
- break / continue inside the loop
- Sources: arrays (snapshotted via Dup() + IncRef/DecRef on
  contained objects), and objects (IteratorAggregate via
  getIterator() + scope-aware NewIteratorInScope, falling
  back to the generic z.NewIterator() — same dispatch the
  AST runnableForeach.Run does).
- Non-iterable src (null/int/etc.) emits the same
  "argument must be of type array|object" warning the AST
  emits, then jumps past the loop.

Out of scope (still falls back to AST):
- by-ref form: foreach (\$src as &\$v)
- value/key target other than a plain local (e.g.
  \$arr[0] as the value receiver, list destructure)
- multi-level break/continue (break 2)

Layout puts the unwind opcode at a single label that's
shared by natural loop end (step jumps there on
\!iter.Valid) and break (which patches there). Continue
patches the advance target. Init's "not iterable" jump
lands past the unwind so we don't over-pop.

phpt suite under GORO_VM=1: zero new regressions (the one
flakey test, bug81104, is a memory-limit timing test that
also flakes on AST).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

120 of 196 new or added lines in 4 files covered. (61.22%)

92 existing lines in 5 files now uncovered.

7652 of 114004 relevant lines covered (6.71%)

802.74 hits per line

Uncovered Changes

Lines Coverage ∆ File
53
35.37
core/vm/ops_foreach.go
14
60.05
2.41% core/vm/vm.go
8
77.46
2.13% core/vm/vmcompiler/emit_stmt.go
1
72.0
0.99% core/compiler/vmaccess.go

Coverage Regressions

Lines Coverage ∆ File
58
77.46
2.13% core/vm/vmcompiler/emit_stmt.go
29
60.05
2.41% core/vm/vm.go
3
84.21
0.0% core/vm/frame.go
1
72.0
0.99% core/compiler/vmaccess.go
1
83.33
0.0% core/vm/opcode.go
Jobs
ID Job ID Ran Files Coverage
1 25325471162.1 04 May 2026 02:44PM UTC 394
6.71
GitHub Action Run
Source Files on build 25325471162
  • Tree
  • List 394
  • Changed 23
  • Source Changed 5
  • Coverage Changed 23
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25325471162
  • d6053e95 on github
  • Prev Build on master (#25324667258)
  • Next Build on master (#25336161853)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc