Skip to content

->__invoke() on an erased Closure runs an unrelated class's __invoke when the program defines one. #396

Closed

Description

@blacktrs

Summary

->__invoke() on an erased Closure runs an unrelated class's __invoke when the program defines one.

Repro

<?php
class C { function __invoke($a) { return $a * 3; } }
function id($x) { return $x; }
$f = id(fn($q) => $q + 100);
echo $f->__invoke(2), "\n";

Expected (php)

102

Actual (manticore 96d0daa4, Darwin arm64)

6

Tracking

Known-bug repro: tests/aot/repro/wrong/closure_explicit_invoke_erased.php — bash tests/aot/xfail.sh -k closure_explicit_invoke_erased 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
    wrong-answer
    on Oct 23, 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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions