Skip to content

Regression: fadd/fsub/fmul/fmax/fmin/nextafter Reflection arity 0 — Zend float stubs (ext/standard/math.stub.php) #27617

Closed as not planned

Description

@PurHur

Category

Regression · php-src-strict · Reflection / PHP 8.4 math builtins

Problem

Under PHP_COMPILER_PROFILE=8.4, the IEEE float builtins fadd / fsub / fmul / fmax / fmin / nextafter are callable (positional works) but Reflection reports 0 parameters and no return type. Zend named args (num1 / num2, fmax value / ...values) therefore fail with Unknown named parameter.

Distinct from #25459 (max/min/pow/fdiv/fmod) and #27600 (fpow/bcdivmod).

Surface (PROFILE=8.4, 2026-08-04) Zend 8.4 stubs VM
ReflectionFunction('fadd')->getNumberOfParameters() 2 0
return type float none
fadd(num1: 1.5, num2: 2.25) 3.75 Error: Unknown named parameter $num1
fadd(1.5, 2.25) positional 3.75 3.75

Same arity-0 pattern for fsub/fmul/fmax/fmin/nextafter.

php-src reference

PHP implementation target

  • lib/BuiltinInternalArgInfo.php / lib/BuiltinParamNames.php — add Zend stub rows (missing today; fmod/fpow partially covered)
  • ext/standard/fadd.php (+ fsub/fmul/fmax/fmin/nextafter) — ensure Reflection registration matches stubs
  • PHP-in-PHP; no new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_fadd_fmax_nextafter_reflection.php'

Done when

  • Reflection arity/types/names match Zend stubs for all six builtins
  • fadd(num1:…, num2:…) and fmax(value:…, …) accept Zend named args
  • Compliance .phpt Reflection + named-arg smoke under PROFILE=8.4
  • 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 Aug 4, 2026
  2. PurHur commented on Aug 7, 2026

    @PurHur
    OwnerAuthor

    Maintainer note (2026-08-07): live php:8.4-cli 8.4.24 and php:8.5-cli 8.5.8 report function_exists('fadd'|'fmax'|'nextafter'|…) === false. These are not Zend stub surfaces to Reflection-fix — they are phantoms. Tracking removal/gating in #28565. This issue’s “match Zend float stubs” premise should be closed or rewritten against #28565 done-when.

  3. PurHur commented on Aug 7, 2026

    @PurHur
    OwnerAuthor

    Closing as not planned: Zend 8.4/8.5 do not ship these builtins. Phantom removal tracked in #28565.

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