Skip to content

Regression: max/min/pow/fdiv/fmod Reflection types/names — Zend value/...values, num/exponent, num1/num2 (ext/standard/math.stub.php) #25459

Closed

Description

@PurHur

Category

Stdlib · php-src-strict · Reflection stubs / math

Problem

Reflection metadata for max / min / pow / fdiv / fmod diverges from Zend stubs. Observable fallout: pow(num: 2, exponent: 3) works on Zend and throws Error: Unknown named parameter $num on VM (base/exponent instead of num/exponent). fmod uses x/y instead of num1/num2. Return/param types for max/min/fdiv are also wrong or missing.

Surface Zend 8.2 (2026-07-30) VM (2026-07-30)
max (mixed): mixed value, ...mixed values (-): array value, ...values
min (mixed): mixed value, ...mixed values (-): array|int value, ...values
pow (object|int|float): mixed num, mixed exponent (float): float base, float exponent
fdiv (float): float num1, float num2 (-): num1, num2 (untyped)
fmod (float): float num1, float num2 (float): float x, float y
pow(num:2, exponent:3) 8 Error: Unknown named parameter $num

Related open: #23259 (abs/floor/ceil number→num), #24825 (round) — this issue is the remaining max/min/pow/fdiv/fmod cluster.

php-src reference

PHP implementation target

  • Reflection/param-name tables for these builtins in ext/standard/ (+ VM Reflection registration) — match Zend names/types/variadics; PHP-in-PHP; no new runtime/*.c

Repro

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

Done when

  • Reflection signatures match Zend for max/min/pow/fdiv/fmod (names, types, variadic, returns)
  • pow(num: 2, exponent: 3) and fmod(num1: …, num2: …) accept Zend named args
  • Compliance .phpt Reflection + named-arg smoke
  • php-src-strict; no php-compiler-strict shortcut

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 30, 2026
  2. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    Cleanup hygiene: closed duplicate #27794 (fmod-only Reflection $x/$y→$num1/$num2). Prefer this broader math Reflection ticket. Related: #23306 still open for pow/sqrt/fmod name drift — keep both if scope differs (types vs names-only); do not re-file fmod-only.

  3. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    claim: compile-trust-lane-b — starting this run (lane overflow; #32122 closed, aot-smoke 8/8, #31968 children closed, no open AOT crash IR)

  4. PurHur commented on Aug 22, 2026

    @PurHur
    OwnerAuthor

    merged in #33875

    verification:

    • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_25459_max_min_pow_fdiv_reflection.php' → max/min/pow/fdiv Reflection + named args match Zend
    • ./script/phpunit.sh --filter 'MaxMinPowFdivReflection|testMaxMinPowFdivReflectionStubTypes' → OK (3 tests, 19 assertions)
    • ./script/aot-smoke.sh → 8/8

    lane overflow: #32122 closed, aot-smoke green, #31968 children closed; no open AOT crash IR this run.

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