Skip to content

A get hook returning an int for a float-typed property is not converted int to float, so var_dump prints float(5.0E-324). #490

Closed

Description

@blacktrs

Summary

A get hook returning an int for a float-typed property is not converted int to float, so var_dump prints float(5.0E-324).

Repro

<?php
class A { public float $f { get => 1; } public float|string $u { get => 2; } }
$a = new A();
var_dump($a->f);
var_dump($a->u);

Expected (php)

float(1)
float(2)

Actual (manticore 93459368, Darwin arm64)

float(5.0E-324)
int(2)

Tracking

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