Skip to content

Regression: round Reflection — num float not int|float; mode default 0 not PHP_ROUND_HALF_UP (ext/standard/math.stub.php) #24825

Closed

Description

@PurHur

Category

stdlib · php-src-strict · Reflection stubs

Problem

ReflectionFunction('round') diverges from php-src on the num parameter type and the mode default (2026-07-29, fd3b1fedc). Zend defaults mode to PHP_ROUND_HALF_UP (1); VM defaults to 0.

Param Zend 8.2 VM
num req typ=int|float req typ=float
precision opt=0 typ=int opt=0 typ=int (ok)
mode opt=1 (PHP_ROUND_HALF_UP) typ=int opt=0 typ=int

php-src reference

PHP implementation target

  • ext/standard Reflection metadata for round — num: int|float, mode default PHP_ROUND_HALF_UP (1)
  • PHP-in-PHP only; no new C

Repro

./script/docker-exec.sh -- bash -lc 'php test/repro/round_reflection_parity.php; php bin/vm.php test/repro/round_reflection_parity.php'

Done when

  • Reflection matches Zend for num union and mode default 1
  • Guard test; php-src-strict

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 29, 2026
  2. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    claim: implementer-worker-lane-a — starting this run (lane overflow; north-star #32122/#31968 children all closed; aot-smoke 8/8; differential-sweep --aot 121/121)

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:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions