How can i get the PHP magic constant __FILE__ work with Eclipse and PDT

后端 未结 5 1072
刺人心
刺人心 2021-02-20 04:23

Lately when i was debugging some PHP file with XDebug (under Eclipse on Ubuntu) i came across a strange behaviour:

print(__FILE__);

resulted in

5条回答
  •  -上瘾入骨i
    2021-02-20 05:07

    I know it is an old question. I solved by assigning it to a variable, then it works fine!

    $file = __FILE__;
    include dirname($file) . '/../whateverfile.php';
    

提交回复
热议问题