I have a static class that loads additional php file inside of one of its function and I need to access class variables from this file withous knowing the class name.
But This::SomeVar – doesn’t work.
But I know there’s another way to do it, I just can’t find anything about it.
So here’s the example class
class SomeClass {
static function Initialize() {
require_once 'somefile.php';
}
}
and inside that file I need to access static variable something like this
This::SomeVar= 'qwe';
Use
self::$SomeVarto access static class members.