php how to get __DIR__ of child class

jonat420

New Member
I have two classes in separate folders\[code\]class Parent{ public $path = null; function __construct() { $this->path = __DIR__; }}\[/code\]and\[code\]class Child extends Parent{}\[/code\]So when I create an instance of Child:\[code\]$child = new Child();echo $child->path\[/code\]I get a path to Parent. What I actually want is to get path to Child. I cannot modify Child class.Is it possible?
 
Back
Top