Unmatched ‘)’

Description

PHP has encountered a closing parenthesis, but has no related opening parenthesis.

In more complex situations, there might be opening and closing parenthesis: this error reports that there are more closing ones than opening. Eventually, some will not have a matching bracket.

Inside double-quoted strings, the unmatched closing brackets are ignored, and used as literal value.

Example

<?php

$a = 1 + 2)

// One too many parenthesis
if (in_array(foo(), array()))) { doSomething(); }

?>

Solutions

  • Remove the closing curly bracket.

  • Add an opening closing curly bracket.