Unclosed '(' on line %s does not match ']'

Description

PHP keeps track of parenthesiss and square brackets. Any of them that is opened, must be closed by the corresponding one. In the current situation, an open parenthesiss is followed by a closing square bracket, which does not match.

Example

<?php

$array = [foo(1, 2];

?>

Literal Examples

  • Unclosed ‘(’ on line 17 does not match ‘]’

Solutions

  • Close the parenthesis before the closing square bracket.

  • Open a square bracket after the opening parenthesis.