Skip to content

valid() on an unstarted Generator reached through a method-call receiver of Iterator type SIGSEGVs #227

Closed

Description

@blacktrs

Summary

valid() on an unstarted Generator reached through a method-call receiver of Iterator type SIGSEGVs.

Repro

<?php
function g() { yield 'a' => 1; yield 'b' => 2; }
class W { public function __construct(private Iterator $i) {} public function inner(): Iterator { return $this->i; } }
$w = new W(g());
var_dump($w->inner()->valid());

Expected (php)

bool(true)

Actual (manticore f9ab5637, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught Error: Call to undefined method Iterator::valid()

Tracking

Known-bug repro: tests/aot/repro/crash/generator_valid_via_call_receiver.php — bash tests/aot/xfail.sh -k generator_valid_via_call_receiver reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    crash
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions