Skip to content

int list property widened by a float append through a method: the float reads back as int (0), later unshift/sort inherit it #76

Closed

Description

@blacktrs

Summary

int list property widened by a float append through a method: the float reads back as int (0), later unshift/sort inherit it.

Repro

<?php
// item: 25
class P { public array $j; function __construct(array $j) { $this->j = $j; } function add($v) { $this->j[] = $v; } }
$p = new P([3, 1, 2]);
$p->add(1.5);
echo json_encode($p->j), "\n";
array_unshift($p->j, 4);
echo json_encode($p->j), "\n";

Expected (php)

[3,1,2,1.5]
[4,3,1,2,1.5]

Actual (manticore 09cb49fb, Darwin arm64)

[3,1,2,0]
[4,3,1,2,0]

Tracking

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