Skip to content

A function whose only return is an int literal, when it falls off the end, yields int(0) where php yields NULL. #542

Closed

Description

@blacktrs

Summary

A function whose only return is an int literal, when it falls off the end, yields int(0) where php yields NULL.

Repro

<?php
function h($x) { if ($x) { return 1; } }
var_dump(h(true));
var_dump(h(false));

Expected (php)

int(1)
NULL

Actual (manticore 4939f76c, Darwin arm64)

int(1)
int(0)

Tracking

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