syntax error, unexpected token “match”, expecting “(”

Description

Since match was introduced as a PHP keyword, it cannot be used anymore to name a class, interface, enum, trait, function or global constant. It may be used to name a class constant, method or property.

Example

<?php

function match($a) {}

?>

Solutions

  • Change the name match.

  • Make the function a method in a class.