Skip to content

Language: error and exception semantics parity corpus — uncaught exception output, warnings text and ordering, set_error_handler/set_exception_handler/register_shutdown_function, destructor order at shutdown, exit codes, compared on **stderr and exit status** against Zend (test/differential/cases/errors/, script/differential-sweep.sh --stderr) #36383

Description

@PurHur

Category

Language: · behaviour users see when things go wrong · child of #36379

Why

The differential sweep compares stdout; the compliance corpus compares recorded stdout. Nothing compares stderr text, warning order, exit code and shutdown sequence against Zend — and those are what frameworks, test runners and ops tooling depend on (register_shutdown_function for fatal handling, set_error_handler for converting warnings to exceptions, exit codes for CI). Wave 1 found VM fatals that exited 255 silently (#36208) and a false "Undefined variable" warning (#36245); the class is wider than that.

Deliverable

  • script/differential-sweep.sh --stderr: compare stdout, stderr (after normalising paths/line numbers via a small allowlist of regexes) and exit status.
  • 40 cases under test/differential/cases/errors/: uncaught exception (message/trace format), nested exception chain with getPrevious, warning inside a function called from a loop, @ suppression, set_error_handler returning false, exception thrown from __destruct, destructor order for globals/locals at shutdown, exit() inside finally, register_shutdown_function after fatal, error inside included file (file:line must be the included file), E_DEPRECATED on PHP 8.4 profile, TypeError messages for typed params/returns, DivisionByZeroError, ArgumentCountError, uncaught Error in {main} exit code 255, exit(3) propagation, assert() failure.
  • AOT-BASELINE gets a stderr section; the corpus runs in the compiler gate.

Done when

  • --stderr mode exists and is green for VM on the 40 cases; AOT failing-name list recorded with an issue per shape
  • Uncaught exception output under AOT matches Zend byte-for-byte for the chained-exception and included-file cases

Activity

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

    IMPORTANTCritical patharea:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions