Skip to content

A function name taken from a foreach over a string array calls the wrong arm: strlen(-5) gives float(0). #304

Closed

Description

@blacktrs

Summary

A function name taken from a foreach over a string array calls the wrong arm: strlen(-5) gives float(0).

Repro

<?php
foreach (["strlen"] as $n) { $f = $n; var_dump($f(-5)); }

Expected (php)

int(2)

Actual (manticore 6df3b897, Darwin arm64)

float(0)

Tracking

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