Skip to content

$value = $callable($value) inside a loop turns an array holding a bool into []. #569

Closed

Description

@blacktrs

Summary

$value = $callable($value) inside a loop turns an array holding a bool into [].

Repro

<?php
function id(array $v) { return $v; }
$value = ['a' => 'x', 'b' => true];
foreach (['id'] as $c) { $value = $c($value); }
echo json_encode($value), "\n";

Expected (php)

{"a":"x","b":true}

Actual (manticore ecee15c7, Darwin arm64)

[]

Tracking

Known-bug repro: tests/aot/repro/wrong/callable_in_loop_reassigns_bool_array.php — bash tests/aot/xfail.sh -k callable_in_loop_reassigns_bool_array 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 Nov 4, 2026
  2. added 2 commits that reference this issue on Nov 8, 2026
    c90a1ef
    8db11db
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