PHP Compilation of Errors and Warnings Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Appearance:

"Paamayim Nekudotayim" means "double colon" in Hebrew; thus this error refers to the inappropriate use of the double colon operator (::). The error is typically caused by an attempt to call a static method that is, in fact, not static.

Possible Solution:

$classname::doMethod();

If the above code causes this error, you most likely need to simply change the way you call the method:

$classname->doMethod();

The latter example assumes that $classname is an instance of a class, and the doMethod() is not a static method of that class.



Got any PHP Question?