I have a problem with accessing parents (non-static) property in child class static method. I've tried these as below:
class Parent
{
protected $nonStatic;
// Other methods and properties
}
class Child extends Parent
{
public static function staticFunc()
{
$test = $this->nonStatic; # Using $this when not in object context
$test = self::$nonStatic; # Access to undeclared static property
$test = parent::$nonStatic # Access to undeclared static property
}
}
I checked similar question in stackoverflow, but i didn't get any working solution
P.S. Sorry about typos, and code above is a dummy example