Menu

← Back to function.*

Error Identifier: function.nameCase

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 myFunction(): void
{
}

MyFunction();

Why is it reported? #

The function is being called with a different letter casing than its declaration. While PHP function names are case-insensitive and the code will work at runtime, using incorrect casing is considered poor practice. It makes code harder to read and can cause confusion about which function is being called.

In the example above, myFunction is declared with a lowercase m, but called as MyFunction with an uppercase M.

How to fix it #

Match the casing of the function call to the function declaration:

 <?php declare(strict_types = 1);
 
-MyFunction();
+myFunction();

How to ignore this error #

You can use the identifier function.nameCase to ignore this error using a comment:

// @phpstan-ignore function.nameCase
codeThatProducesTheError();

You can also use only the identifier key to ignore all errors of the same type in your configuration file in the ignoreErrors parameter:

parameters:
	ignoreErrors:
		-
			identifier: function.nameCase

Rules that report this error #

  • PHPStan\Rules\Functions\CallToNonExistentFunctionRule [1]
  • PHPStan\Rules\Functions\FunctionCallableRule [1]
  • PHPStan\Rules\Namespaces\ExistingNamesInGroupUseRule [1]
  • PHPStan\Rules\Namespaces\ExistingNamesInUseRule [1]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.