syntax error, unexpected token “=”

Description

The = assignation operator is found after a constant name. Constants are defined with const keyword, and later, they are not changed.

Example

<?php

a = 1;

?>

Solutions

  • Turn the constant name into a variable name by adding a $ sign before it.

  • Make this code a constant definition by adding const before it, if it was not already defined.