Skip to content

$c ? [3,4] : [$n,5] is typed list<int> although $n is mixed: the non-int element reads back as a raw word #77

Closed

Description

@blacktrs

Summary

$c ? [3,4] : [$n,5] is typed list although $n is mixed: the non-int element reads back as a raw word.

Repro

<?php
// item: 28
function f(bool $c, $n) { $r = $c ? [3, 4] : [$n, 5]; var_dump($r[0]); }
f(false, "x");
f(false, 2.5);

Expected (php)

string(1) "x"
float(2.5)

Actual (manticore 09cb49fb, Darwin arm64)

int(-3377695357148256)
int(4612811918334230528)

Tracking

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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions