Menu

Error Identifier: ignore.allLineErrors

← Back to ignore.*

Every error reported by PHPStan has an error identifier. Here’s a list of all error identifiers. In PHPStan Pro you can see the error identifier next to each error and filter errors by their identifiers.

Code example #

In phpstan.neon:

parameters:
	reportIgnoresWithoutComments: true
<?php

// @phpstan-ignore-next-line
echo $undefined;

echo $anotherUndefined; // @phpstan-ignore-line

Why is it reported? #

When reportIgnoresWithoutComments is enabled, PHPStan disallows @phpstan-ignore-next-line and @phpstan-ignore-line completely. These directives suppress all errors on a line without specifying which error identifiers are being ignored and without requiring an explanation.

This makes it too easy to accidentally suppress unrelated errors that appear on the same line in the future.

How to fix it #

Replace the blanket ignore with @phpstan-ignore using a specific error identifier and a comment explaining why:

-// @phpstan-ignore-next-line
+// @phpstan-ignore variable.undefined (used for legacy compatibility)
 echo $undefined;
-echo $anotherUndefined; // @phpstan-ignore-line
+echo $anotherUndefined; // @phpstan-ignore variable.undefined (loaded dynamically)

Each identifier must have an accompanying comment in parentheses. Learn more about ignoring errors in Ignoring Errors.

Non-ignorable error #

This error cannot be ignored using @phpstan-ignore or the ignoreErrors configuration. Non-ignorable errors indicate code that would cause a crash or a fatal error at runtime, or a fundamental problem in the analysed code that must be addressed.

Rules that report this error #

  • PHPStan\Analyser\FileAnalyser [1]
Theme
A
© 2026 PHPStan s.r.o.