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

Description

It is not possible to use __NAMESPACE__ or any other magic constant as a function or method name. This error is case insensitive.

Example

<?php

function __NAMESPACE__() {}

?>

Literal Examples

  • syntax-error

Solutions

  • Use another name than __NAMESPACE__.