-2

Is there a way around the following:

class static extends parents {
    // etc
}

Where 'static' is the name of the class and 'parents' is a legal extended class name.

The following throws this error:

Parse error: syntax error, unexpected T_STATIC, expecting T_STRING

Any help/suggestions would be gratefully appreciated.

nderjung
  • 1,607
  • 4
  • 17
  • 38

1 Answers1

5

static is a keyword. You can not use them as a class name. In php.net its clearly stated.

These words have special meaning in PHP. Some of them represent things which look like functions, some look like constants, and so on - but they're not, really: they are language constructs. You cannot use any of the following words as constants, class names, function or method *names*. Using them as variable names is generally OK, but could lead to confusion.

Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187