syntax error, unexpected token “(”, expecting “::”

Description

This error appears when calling static as a function. static cannot be used as a function name. It may be used as class name, in a new expression, or as an method. It is often used in a static call, for methods, constant or properties.

It is not recommended to use static as a method name.

Example

<?php

static();

?>

Solutions

  • Add the object before the method name.

  • Add the class name and :: before the method name.

  • Add the new operator before the static keyword. Make sure that code is within a class or assimilated.