小编ehp*_*hpc的帖子

默认的Visual Studio 2010和2008字体

Visual Studio 2010和2008编辑器中的默认字体(及其大小)是多少?

fonts visual-studio

54
推荐指数
5
解决办法
4万
查看次数

php how to get __DIR__ of child class

I have two classes in separate folders

class Parent
{
    public $path = null;

    function  __construct()
    {
        $this->path = __DIR__;
    }
}
Run Code Online (Sandbox Code Playgroud)

and

class Child extends Parent
{

}
Run Code Online (Sandbox Code Playgroud)

So when I create an instance of Child:

$child = new Child();
echo $child->path
Run Code Online (Sandbox Code Playgroud)

I get a path to Parent. What I actually want is to get path to Child. I cannot modify Child class.

Is it possible?

php oop

11
推荐指数
1
解决办法
3854
查看次数

标签 统计

fonts ×1

oop ×1

php ×1

visual-studio ×1