Skip to content

Regression: fadd/fsub/fmul/fmax/fmin/nextafter phantoms on PROFILE≥8.4 — absent from php-src (ext/standard/math.c) #28565

Closed

Description

@PurHur

Category

bug · php-src-strict · PROFILE≥8.4 phantom builtins · pillar 4

Problem

Under PHP_COMPILER_PROFILE=8.4 / 8.5, function_exists() is true for fadd, fsub, fmul, fmax, fmin, and nextafter, and positional calls succeed. Zend/php-src 8.4.24 and 8.5.8 do not define these functions (function_exists false). They are compiler phantoms — not Reflection-stub mismatches against real Zend APIs.

Sibling #27617 assumed Zend float stubs exist; live php:8.4-cli / php:8.5-cli show otherwise. fpow / fdiv / fmod do exist on Zend and are out of scope here.

Probed 2026-08-07 @ fdf529e8bd.

Builtin Zend 8.4.24 Zend 8.5.8 VM PROFILE=8.4/8.5
fpow Y Y Y (OK)
fadd/fsub/fmul N N Y (phantom)
fmax/fmin/nextafter N N Y (phantom)

php-src reference

  • php/php-src ext/standard/math.c — fpow/fdiv/fmod only among this family
  • No fadd/fmax/nextafter in php-src 8.4/8.5 stubs (verified via live Zend containers)

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/fmath.php <<'"'"'PHP'"'"'
<?php
foreach (["fadd","fsub","fmul","fmax","fmin","nextafter","fpow"] as $f) {
  echo $f, "=", function_exists($f) ? "Y" : "N", "\n";
}
PHP
echo VM84:; PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/fmath.php'
# Zend: docker run --rm -i php:8.4-cli php < /tmp/fmath.php

Expected (Zend): only fpow=Y among the phantom set; fadd…nextafter=N.

Done when

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

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

    Gate snapshot before work:

    Plan: gate/remove fadd/fsub/fmul/fmax/fmin/nextafter on php-src-strict so PROFILE≥8.4 matches Zend (function_exists false); keep fpow/fdiv/fmod.

  3. PurHur commented on Aug 7, 2026

    @PurHur
    OwnerAuthor

    Merged #28626

    Verification

    • inventory OK 7203/7203; release-readiness user_release_ready: yes
    • Zend 8.4: phantoms absent; fpow present
    • VM + AOT repros green under PHP_COMPILER_PROFILE=8.4
    • unit + AOT PHPT phantoms green
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