There is a class with such methods.
private function GetBannerInf() { return 123; } static function GetPathBanner() { return $this->GetBannerInf(); } Does not work. gives the error Fatal error: Using $ this when not in object context ...
But if you write like this: return self :: GetBannerInf ();
Question 1, why self :: GetBannerInf (); if the GetBannerInf () method is not static. Question 2, why the first option does not work through this?
this? That's why it is static, which can be called even by the name of a class, without an object. - pavelАбстракции. Your question goes against the principles of oop. In this particular example or case, you cannot call this method via$thisornew self, etc. Since it violates the principles of this oop. At a minimum, you must change the scope of the method and call as 'new static' or 'new self' and later call from the object, or call the method as is. - Naumov