Skip to content

array_map with several arrays (and array_map(null, ...)) only walks the first array #405

Closed

Description

@blacktrs

Summary

array_map with several arrays (and array_map(null, ...)) only walks the first array.

Repro

<?php
print_r(array_map(fn($a, $b) => $a . $b, ['a', 'b'], ['x', 'y']));
print_r(array_map(null, [1, 2], [3, 4]));

Expected (php)

Array
(
    [0] => ax
    [1] => by
)
Array
(
    [0] => Array
        (
            [0] => 1
            [1] => 3
        )

    [1] => Array
        (
            [0] => 2
            [1] => 4
        )

)

Actual (manticore 57b5de57, Darwin arm64)

Array
(
    [0] => a0
    [1] => b0
)
Array
(
    [0] => 1
    [1] => 2
)

Tracking

Known-bug repro: tests/aot/repro/wrong/array_map_multiple_arrays_uses_first.php — bash tests/aot/xfail.sh -k array_map_multiple_arrays_uses_first 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
  2. added a commit that references this issue on Oct 23, 2026
    ea17ec6
  3. added a commit that references this issue on Oct 24, 2026
    a15ad0f
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