Skip to content

Regression: atan2()/pow()/fmod()/intdiv()/base_convert()/log() arity — LogicException not ArgumentCountError (ext/standard, re-#21964) #21982

Closed

Description

@PurHur

Category

Regression · php-src-strict · stdlib arity (pillar 4; sibling of #21964)

Problem

#21964 covers strpos/implode/count/… wrong-arity throwing LogicException instead of ArgumentCountError. The same bug remains for several math/base_convert builtins: under-arity throws LogicException from hand-rolled argc checks.

Repro Zend 8.2+ VM (2026-07-21)
atan2(1) ArgumentCountError LogicException
pow(2) ArgumentCountError LogicException
fmod(5) ArgumentCountError LogicException
intdiv(5) ArgumentCountError LogicException
base_convert('10', 2) ArgumentCountError LogicException
log() ArgumentCountError LogicException

php-src reference

PHP implementation target

Repro

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

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 Jul 21, 2026
  2. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

    Pre-triage gates (host):

    Implementing ArgumentCountError for atan2/pow/fmod/intdiv/base_convert/log under-arity (sibling of closed #21964).

  3. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    Merged in #22057

    Verification: VM + JIT repro green; ./script/phpunit.sh --filter issue21982_math_arity → OK (4 tests). AOT compile currently red on master for HelloWorld too (StringOffsetRuntime zExt / htmlspecialchars bridge) — not introduced by this change; JIT covers the arity path.

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