Class A {$ x = Array ();//Although this kind of writing is supported, but it is not recommended, should be written as public $x = Array (); private static $y = $x;//This is a very obvious syntax error, first here cannot use the variable, the second access property should be $this->x}
Class static variables and constant declarations can not be used variables, is a syntax error. I think it's because the variables are not assigned when the object has no instances, so neither static variables nor constants can get valid values.
Recommendation:
1-Modify the php.ini to display the error message so that you do not see the dry 500 error, but the reason for the error of the PHP prompt, which helps to solve the problem
2-using the more professional PHP development IDE, Like Phpstorm or Zendstudio (I'm using this), this simple syntax error is directly red by the IDE.
Suggest you learn PHP grammar, write a syntax error code out, there is no weird problem is not weird.
What is contained in the class: Static methods and properties that are about classes The other is the object's (instance of the Class) method and property
Statically, of course, cannot directly invoke what belongs to the object (the object does not exist yet!!!
This is the basic concept of object-oriented ...
Foundation did not learn to write code directly, only to say that the abuse of their own life