I have a class like the following:
class game {
public $db;
public $check;
public $lang;
public function __construct() {
$this->che
if you mark the public $lang;
as static:
public static $lang;
you can access it via game::$lang;
if not static, you need to make an instance of game and directly access it:
$game = new game;
$game->lang;
static call inside of (current) class:
self::$lang;
late static bound call (to inherited static variable):
static::$lang;
call from child class to parent:
parent::$lang;
normal call inside of an instance (instance is when you use new Obj();
):
$this->lang;
BTW:
variables defined by define('DEFAULT_LANG', 'en_EN');
are GLOBAL scope, mean, can access everywhere!