Skip to content

Appending a string to a string-keyed int array param (mixed int|string keys) then print_r crashes. #259

Closed

Description

@blacktrs

Summary

Appending a string to a string-keyed int array param (mixed int|string keys) then print_r crashes.

Repro

<?php
function f(array $a): array { $a[] = 'tail'; return $a; }
print_r(f(['x' => 1, 'y' => 2]));

Expected (php)

Array
(
    [x] => 1
    [y] => 2
    [0] => tail
)

Actual (manticore 2b2190b5, Darwin arm64)

Array
(
    [x] => 1
    [y] => 2
    [0] => 4375132624
)

Tracking

Known-bug repro: tests/aot/repro/crash/append_string_to_string_keyed_array_param.php — bash tests/aot/xfail.sh -k append_string_to_string_keyed_array_param reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions