Skip to content

A closure returning a mixed float 0.0, called through a callable parameter, yields NULL instead of float(0) #229

Closed

Description

@blacktrs

Summary

A closure returning a mixed float 0.0, called through a callable parameter, yields NULL instead of float(0).

Repro

<?php
function show(callable $f): void { var_dump($f()); }
show(fn() => json_decode('0.0'));
show(fn() => current([0.0]));
show(fn() => json_decode('0.5'));

Expected (php)

float(0)
float(0)
float(0.5)

Actual (manticore c9f626cd, Darwin arm64)

NULL
NULL
float(0.5)

Tracking

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