How to implement a similar design?
class LogBase { function __construct() {} public function write($message) { fwrite(self::$file, "bla-bla"); } } class Log extends LogBase { private $file = 'address/to/file'; }
(abbreviated).
That is, I wanted to implement all the functionality in the parent (but not used class), but because I need several different logs, create descendant classes, which will be given the path to the log. But if you use
Log::write('something');
then self::$file
in this case leads to the parent class, in which this variable, of course, does not.