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

Description

final is not a valid name for a function. It is a valid name for a method, though.

Example

<?php

function final() {};

?>

Solutions

  • Use another name for that function.

  • Remove the name, and create a closure instead.