Skip to content

A method call passing an int to a float parameter does not convert it (plain function calls do). #228

Closed

Description

@blacktrs

Summary

A method call passing an int to a float parameter does not convert it (plain function calls do).

Repro

<?php
final class K
{
    public function g(float $a, float $b): float
    {
        return $a + $b;
    }
}
function h(float $a, float $b): float
{
    return $a + $b;
}
$k = new K();
var_dump($k->g(0, 1));
var_dump(h(0, 1));
$i = 3;
var_dump($k->g($i, 1));

Expected (php)

float(1)
float(1)
float(4)

Actual (manticore f9ab5637, Darwin arm64)

float(5.0E-324)
float(1)
float(2.0E-323)

Tracking

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

Activity

  1. added
    bug
    wrong-answer
    on Oct 13, 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