syntax error, unexpected token “]”

Description

This error appeas when the closing bracket is needed, but not at that place.

In the illustration, the closing square bracket should be not be used directly after a multiplication sign: that operator needs a second operand.

Example

<?php

$a = [3 * 3 * ];

?>

Solutions

  • Add the missing operand to the previous operator.