Skip to content

Regression: abs/floor/ceil Reflection names number — Zend num; named args rejected (ext/standard/basic_functions.stub.php) #23259

Closed

Description

@PurHur

Category

bug · php-src-strict · named arguments / Reflection

Problem

Positional math builtins match Zend, but Reflection reports number instead of Zend stub num, and Zend-style named calls fail. Probed 2026-07-26 vs host Zend 8.2.32 and php bin/vm.php.

Repro Zend 8.2 VM (2026-07-26)
Reflection names num number
abs(-3) / floor(1.5) / ceil(1.2) 3 / 1.0 / 2.0 same
abs(num: -3) 3 Unknown named parameter $num
abs(number: -3) Unknown named parameter $number Unknown named parameter $number
floor(num: 1.5) / ceil(num: 1.2) Zend OK Unknown named parameter $num

php-src reference

PHP implementation target

  • lib/BuiltinParamNames.php — map abs/floor/ceil → ['num']
  • Reflection + named-arg dispatch; PHP-in-PHP only; no new C runtime logic

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''foreach (["abs","floor","ceil"] as $f) { $r=new ReflectionFunction($f); foreach($r->getParameters() as $p) echo $f, " ", $p->getName(), PHP_EOL; } try { var_export(abs(num:-3)); echo PHP_EOL; } catch (Throwable $e) { echo $e->getMessage(), PHP_EOL; }'\'''

Done when

  • Reflection name is num for abs / floor / ceil
  • Zend-style named calls match Zend on VM
  • Compliance .phpt + test/repro/issue_NNNN_*.php
  • 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 26, 2026
  2. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

    Pre-claim gates (mandatory probe):

    • php script/bootstrap-inventory.php --check: exit 0; docs report file-list drift (stale committed inventory) — not treating as Pillar 1 merge blocker for this Reflection/named-arg fix
    • docker info: ok
    • ./script/release-readiness.sh --json: still running in background at claim time; will note outcome if it finishes before ship

    Issue: #23259 — abs/floor/ceil Reflection number → Zend num; named num: must work

  3. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    Merged via #25531

    Verification:

    • VM repro test/repro/issue_23259_abs_floor_ceil_named.php → ok (Reflection num, named num: works, number: rejected)
    • Compliance named_args_abs_floor_ceil VM+JIT → OK (6)
    • AOT: abs(num: -3) via compile probe + abs_floor_ceil_named_params fixture → OK
    • Note: floor/ceil AOT positional already return 0 on master (separate from this named-arg fix)
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