Skip to content

test(tests): drop the E_DEPRECATED suppression from the .phpt files - #22

Merged
lisachenko merged 1 commit into
masterfrom
claude/z-engine-stable-updates-00g5v4
Aug 19, 2026
Merged

test(tests): drop the E_DEPRECATED suppression from the .phpt files#22
lisachenko merged 1 commit into
masterfrom
claude/z-engine-stable-updates-00g5v4

Conversation

@lisachenko

Copy link
Copy Markdown
Owner

What changed

Removed the third --INI-- line, error_reporting=E_ALL & ~E_DEPRECATED, from all 19 tests/Functional/*.phpt files. ffi.enable=1 and opcache.jit=off stay — 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 .phpt test" example, and the "Rules for a new test" bullet.
  • .claude/agents/phpt-author.md — the template block and the matching rule.

.github/workflows/ci.yml and README.md were checked and never referenced the line: CI passes only the FFI/JIT pair as ini-values, so no change was needed there. No change to src/, composer.json or 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 .phpt runner forces display_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:

// vendor/lisachenko/z-engine/src/Type/OpLine.php:99  (8.4.2 and 8.5.0 alike)
public function __construct(object $opline, ?ExecutionData $context = null)

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/*, so composer install without --no-dev fails). The suite was instead run through a minimal runner that reproduces what PHPUnit's PhptTestCase does: it writes each --FILE-- body next to the .phpt so the relative vendor/autoload.php include resolves, applies the file's own --INI--, forces display_errors=1, compares --EXPECT-- exactly and matches --EXPECTREGEX-- unanchored. CI runs the real composer test on both minors.

Baseline, before any edit, with error_reporting=E_ALL forced over each file's own --INI-- — i.e. proving the suppression was doing nothing:

PHP z-engine Result
8.4.19 8.4.2 19/19 pass
8.5.9 8.5.0 19/19 pass

After removing the line, each file running under its own two-line --INI--:

PHP z-engine Result
8.4.19 8.4.2 19/19 pass
8.5.9 8.5.0 19/19 pass

No segfaults, bus errors, skipped or incomplete tests in any of the four runs. z-engine was resolved per minor by re-running composer install with the matching binary after clearing vendor/ and composer.lock.

composer cs:fix was not run: php-cs-fixer is a dev dependency and is not installable here. Only .phpt and Markdown files are touched, so PER-CS2.0 does not apply to this diff.

Closes #21


Generated by Claude Code

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
@lisachenko
lisachenko marked this pull request as ready for review August 19, 2026 05:56
@lisachenko
lisachenko merged commit f9a15b0 into master Aug 19, 2026
5 checks passed
@lisachenko
lisachenko deleted the claude/z-engine-stable-updates-00g5v4 branch August 19, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(tests): drop the E_DEPRECATED suppression from the .phpt files — stable z-engine raises none

1 participant