Skip to content

A function called by string name inside a loop returns 0 instead of its result. #306

Closed

Description

@blacktrs

Summary

A function called by string name inside a loop returns 0 instead of its result.

Repro

<?php
function a() { $f = 'strlen'; $c = -1; for ($i = 0; $i < 2; $i++) { $c = $f('abc'); } return $c; }
echo a(), "\n";

Expected (php)

3

Actual (manticore c865cdd2, Darwin arm64)

0

Tracking

Known-bug repro: tests/aot/repro/wrong/dyn_name_call_in_loop.php — bash tests/aot/xfail.sh -k dyn_name_call_in_loop 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 17, 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