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

KarpelesLab / goro / 26350972671
12%

Build:
DEFAULT BRANCH: master
Ran 24 May 2026 03:39AM UTC
Jobs 1
Files 398
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

24 May 2026 03:38AM UTC coverage: 12.429% (+0.02%) from 12.405%
26350972671

push

github

MagicalTux
vm: native foreach over non-by-ref non-local targets

Previously `foreach ($arr as [$a,$b])` / `as $obj->prop` / `as
Foo::$bar` / `as $k => [$a,$b]` etc. were AST-delegated via
OP_TRY_FINALLY, forcing the enclosing function out of slot-only mode
and re-running the whole loop through the AST tree walker.

Adds two opcodes:

  OP_FOREACH_STEP_PUSH (A=keyFlag, C=exhaust-jmp): like OP_FOREACH_STEP
  but pushes value (and key when A=1) onto the stack instead of storing
  into a local slot. Always Dup()s to match the AST runner's snapshot.

  OP_ASSIGN_WRITABLE (A=lhs-ast-idx): pops a value and writes it to the
  AST node at SubASTs[A] via the phpv.Writable interface — handles obj
  prop, array element, static prop, dynamic-name var, etc.

emitForeach now picks per-target shape:
- Both targets bare locals → OP_FOREACH_STEP (unchanged fast path).
- Destructure target → push value, OP_DESTRUCTURE_ASSIGN + refresh slots.
- Other Writable target → push value, OP_ASSIGN_WRITABLE + refresh slots.

By-ref (`as &$v`) still AST-delegates — the iterator needs to yield
refs, which OpForeachInit doesn't build yet. That's the next sub-step.

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

73 of 94 new or added lines in 2 files covered. (77.66%)

19 existing lines in 1 file now uncovered.

14654 of 117903 relevant lines covered (12.43%)

2584.35 hits per line

Uncovered Changes

Lines Coverage ∆ File
13
73.58
0.33% core/vm/vmcompiler/emit_stmt.go
8
61.04
0.14% core/vm/vm.go

Coverage Regressions

Lines Coverage ∆ File
19
34.75
-2.53% core/compiler/compile-foreach.go
Jobs
ID Job ID Ran Files Coverage
1 26350972671.1 24 May 2026 03:39AM UTC 398
12.43
GitHub Action Run
Source Files on build 26350972671
  • Tree
  • List 398
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26350972671
  • 33de8064 on github
  • Prev Build on master (#26350835409)
  • Next Build on master (#26351198757)
  • Delete
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