//...
<?php
class Essentials {
//...
//...
static $root = $_SERVER['DOCUMENT_ROOT'];
}
//...
?>
Php writing an error
Parse error: syntax error, unexpected '$_SERVER' (T_VARIABLE) in /Users/Dima/Desktop/localhost/YouLose/lib/lib.php on line 17
What's the matter? Outside the class it works. In php $_SERVER is "superglobal" as I know