Skip to content

Stdlib: ob_end_clean() extra arguments — LogicException not ArgumentCountError (ext/standard/output.c) #10323

Description

@PurHur

Category

stdlib · php-src-strict

Problem

Zend rejects extra arguments to ob_end_clean() with ArgumentCountError. VM throws LogicException: ob_end_clean() takes no arguments — wrong exception class and message text.

php-src reference

Repro (failure today)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "ob_start(); ob_end_clean(true);" 2>&1 | head -1
php bin/vm.php -r "ob_start(); ob_end_clean(true);" 2>&1 | head -1
'
Runtime Exception
Zend PHP 8.2 ArgumentCountError: ob_end_clean() expects exactly 0 arguments, 1 given
VM LogicException: ob_end_clean() takes no arguments ❌

Scope (this repo)

Path Work
ext/standard/ob_end_clean.php Replace LogicException arity guard with ArgumentCountError via shared builtin arg helper
ext/standard/JitObEndClean.php Mirror at JIT compile time when args present
Tests test/compliance/cases/stdlib/ob_end_clean_argcount.phpt

PHP-in-PHP: arity validation in ext/standard/; reuse VmArgInfo / JitArgCheck patterns from other output builtins.

Done when

Related

Activity

  1. added
    enhancementNew feature or request
    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 Jun 20, 2026
  2. PurHur commented on Jun 28, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — batch (issues #10031, #10323)

  3. PurHur commented on Jun 28, 2026

    @PurHur
    OwnerAuthor

    Verified green on master — ob_end_clean_argc.phpt passes VM+JIT; closing not needed this run.

  4. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-a — starting this run

  5. PurHur commented on Jul 6, 2026

    @PurHur
    OwnerAuthor

    Already fixed on master — ext/standard/ob_end_clean.php and JitObEndClean.php throw ArgumentCountError; test/compliance/cases/stdlib/ob_end_clean_argc.phpt green. Closing via maintainer hygiene.

  6. PurHur commented on Jul 8, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

  7. PurHur commented on Jul 8, 2026

    @PurHur
    OwnerAuthor

    claim released: repro green on master — VM throws ArgumentCountError with Zend message; compliance test/compliance/cases/stdlib/ob_end_clean_argc.phpt exists. Pivoting.

  8. PurHur commented on Jul 8, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

  9. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run.

  10. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    claim released: master already throws ArgumentCountError: ob_end_clean() expects exactly 0 arguments, 1 given — matches Zend. Pivoting to #17633.

  11. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run (ob_end_clean ArgumentCountError parity, #10323).

  12. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

    Unclaiming — master already throws ArgumentCountError; ob_end_clean_argc.phpt green on VM+JIT (verified this run).

  13. PurHur commented on Jul 13, 2026

    @PurHur
    OwnerAuthor

    Maintainer triage 2026-07-13: ob_end_clean(true) now throws ArgumentCountError on VM matching Zend 8.2.32. Closing as fixed.

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 machineenhancementNew feature or requestimplementation-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