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

KarpelesLab / goro / 25772047510

13 May 2026 01:15AM UTC coverage: 12.014% (+0.6%) from 11.374%
25772047510

push

github

MagicalTux
vm: clone, instanceof, do-while, declare, var-var, generator iter

Six more coverage extensions, all via AST delegation:

* \`clone \$x\`, \`\$x instanceof T\`, void cast (used implicitly),
  first-class callables — push result via OpClassConst.
* \`do { … } while (…);\`, \`declare(strict_types=1)\`, \`declare(ticks=N)\`,
  top-level const, enum register, inline HTML — statement form via
  OpTryFinally + OP_REFRESH_SLOTS.
* Dynamic object property name (\`\$obj->{\$expr}\`) and dynamic
  method name (\`\$obj->{\$expr}()\`).

VM foreach over an object implementing the Iterator interface
(notably Generator) now drives the iteration via PHP-level
rewind/valid/current/key/next methods through the AST's
phpObjectIterator (re-exposed as compiler.NewObjectMethodIterator).
Previously the VM used NewIteratorInScope, which iterates over
object properties — wrong for generators and Iterator classes.

Tests: TestCloneInstanceofDoWhile, TestGeneratorIteration. The
unsupported-fallback sentinel is retired since the emitter no
longer has a reachable catch-all for valid scripts; fallback for
generators / by-ref params / by-ref return is still covered by
the integration test.

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

41 of 44 new or added lines in 5 files covered. (93.18%)

21 existing lines in 6 files now uncovered.

13859 of 115356 relevant lines covered (12.01%)

2017.59 hits per line

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

22.78
/core/phpobj/zobject.go


Source Not Available

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