How to get the path of a derived class from an inherited method?

前端 未结 6 1819
轮回少年
轮回少年 2021-01-30 13:11

How to get the path of the current class, from an inherited method?

I have the following:



        
6条回答
  •  别那么骄傲
    2021-01-30 13:32

    
    
    
    getDir(); 
          }
       }
       $tmp = new Child(); // output: '/childDir'
    ?>
    

    Please not that if you need to get the dir, directly use __DIR__.

提交回复
热议问题