test(tests): drop the E_DEPRECATED suppression from the .phpt files - #22
Merged
Merged
Conversation
Every .phpt carried a third --INI-- line, error_reporting=E_ALL & ~E_DEPRECATED.
It existed only because z-engine's development line declared implicitly nullable
parameters (ZEngine\Type\OpLine::__construct()); PHPUnit's .phpt runner forces
display_errors=1, so that deprecation was prepended to the captured output of
every test and failed each --EXPECT-- block.
The stable releases now required (~8.4.2 || ~8.5.0) declare those parameters
?Type, so the line suppresses nothing. Removing it also stops the suite from
hiding a genuine deprecation should one ever appear.
ffi.enable=1 and opcache.jit=off stay — those are load-bearing.
Suite verified at 19/19 on PHP 8.4.19 with z-engine 8.4.2 and on PHP 8.5.9 with
z-engine 8.5.0, both before the change (with error_reporting=E_ALL forced over
each file's own --INI--) and after it.
Docs updated to describe two mandatory --INI-- lines: CLAUDE.md ("Running tests",
the anatomy example, the rules bullet) and .claude/agents/phpt-author.md (template
and rules). No source, composer.json or CI change — ci.yml never referenced the
line.
Closes #21
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013foRd1XwLwqjUSkSWeWrMe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Removed the third
--INI--line,error_reporting=E_ALL & ~E_DEPRECATED, from all 19tests/Functional/*.phptfiles.ffi.enable=1andopcache.jit=offstay — those are load-bearing.Docs updated to describe two mandatory
--INI--lines instead of three:CLAUDE.md— the "Running tests" section, the--INI--block in the "Anatomy of a.phpttest" example, and the "Rules for a new test" bullet..claude/agents/phpt-author.md— the template block and the matching rule..github/workflows/ci.ymlandREADME.mdwere checked and never referenced the line: CI passes only the FFI/JIT pair asini-values, so no change was needed there. No change tosrc/,composer.jsonor the operator handlers.Why the suppression is now dead weight
The line existed for one reason: z-engine's development line declared implicitly nullable parameters (
ZEngine\Type\OpLine::__construct()), which PHP reports as a deprecation. PHPUnit's.phptrunner forcesdisplay_errors=1, so that single deprecation was prepended to the captured output of every test and failed each--EXPECT--block on noise from a dependency.The stable releases now required (
~8.4.2 || ~8.5.0, #20) declare those parameters?Type— confirmed in the installed source on both lines:So the line suppresses nothing today, and while it sits there it would silently swallow a real deprecation from a future dependency bump — turning a visible signal into a failure somewhere harder to find. The docs now say so explicitly rather than leaving the removal unexplained.
Verification
PHPUnit could not be installed in this environment (network egress reaches only
lisachenko/*, socomposer installwithout--no-devfails). The suite was instead run through a minimal runner that reproduces what PHPUnit'sPhptTestCasedoes: it writes each--FILE--body next to the.phptso the relativevendor/autoload.phpinclude resolves, applies the file's own--INI--, forcesdisplay_errors=1, compares--EXPECT--exactly and matches--EXPECTREGEX--unanchored. CI runs the realcomposer teston both minors.Baseline, before any edit, with
error_reporting=E_ALLforced over each file's own--INI--— i.e. proving the suppression was doing nothing:After removing the line, each file running under its own two-line
--INI--:No segfaults, bus errors, skipped or incomplete tests in any of the four runs. z-engine was resolved per minor by re-running
composer installwith the matching binary after clearingvendor/andcomposer.lock.composer cs:fixwas not run: php-cs-fixer is a dev dependency and is not installable here. Only.phptand Markdown files are touched, so PER-CS2.0 does not apply to this diff.Closes #21
Generated by Claude Code