Unclosed ‘[’

Description

The closing square bracket is missing.

It might be missing, as in the first example; it might also be inside a string, as in the second example: the double quote is not closed, which includes the closing square bracket, and makes it missing.

Example

<?php

// This should be at the end of a code, without ; not ?>
$a[$b[3]

$a["3] = 4;

?>

Solutions

  • Check that the square brackets are balanced.

  • Check that the closing square brackets are not hidden in a string.