Menu

← Back to phpstan.*

Error Identifier: phpstan.parse

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 #

<?php declare(strict_types = 1);

function doFoo(): void
{
	$x = ;
}

Why is it reported? #

PHPStan was unable to parse the PHP file due to a syntax error. The file contains invalid PHP code that the parser cannot process. This prevents PHPStan from analysing the file at all.

This error is not ignorable because PHPStan cannot perform any analysis on a file it cannot parse.

How to fix it #

Fix the syntax error in the PHP file. The error message includes the line number and a description of the parsing problem.

 <?php declare(strict_types = 1);
 
 function doFoo(): void
 {
-	$x = ;
+	$x = 1;
 }

If the file intentionally contains non-standard PHP syntax (for example, a template or code snippet), exclude it from PHPStan analysis using the excludePaths configuration option.

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] [2]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.