syntax error, unexpected token “(”, expecting variable

Description

PHP started recognizing a property definition, with its visibility, a type and now expects a variable name. In fact, the function keyword was omitted.

Example

<?php

class X {
    public  __construct () {}
}

?>

Solutions

  • Add the function keyword, before the name of the method.

  • Remove the parenthesis and the following tokens, and make a proper property definition.