Skip to content

/ over two divisible int variables yields float instead of int #46

Open

Description

@blacktrs

Summary

/ over two divisible int variables yields float instead of int.

Also listed in the docs/ROADMAP.md Tier 1 gap matrix.

Repro

<?php
$a = 6;
$b = 2;
var_dump($a / $b);

Expected (php 8.5)

int(3)

Actual (manticore 10affa68, macOS arm64)

float(3)

Tracking

Known-bug repro: tests/aot/repro/wrong/int_div_exact.php — bash tests/aot/xfail.sh -k int_div_exact 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
  2. added
    needs-design
    area:types
    on Oct 13, 2026
  3. blacktrs commented on Oct 13, 2026

    @blacktrs
    ContributorAuthor

    Scope: result-type design. / over two int variables is always typed float; php yields int when divisible. Needs an int|float result type (or VRA / runtime-tagged result) and cascade through InferTypes. Skipped in batch C.

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

    area:typesbugneeds-designwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions