Is it possible to use a global variable as a default value for a static member of a class?
$link = new mysqli("localhost", .....);
class MyClass {
//global $link
//private static $clink = $link;
//private static $clink =& $link;
//private static $clink = global $link;
//global $link
function __construct()
{
......
}
}
I would like to be able to use $link as a global variable throughout the class without declaring it in each function, or $clink as a reference to the global variable $link. Either way I want the variable to be setup by default so the class does not need to have an object declared (no constructor call) for the link to be set up.