Parse error: parse error, expecting `'{” in [closed]

A classname in PHP is limited to the alphanumerics and underscores:

The class name can be any valid label, provided it is not a PHP reserved word. A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: ^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$.

Your usage of - as a separator is not valid for a class name, and PHP fails to parse the name.

The naming scheme should be coherent with the rest of your application, either underscores (Criacao_De_Sites_Bh or CriacaoDeSitesBh).

Leave a Comment