It looks the same for me,but I’m not sure,
because there are many projects that uses dirname(__FILE__).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Their result is exactly the same ; so, no difference on that.
For example, the two following lines :
Will both give the same output :
But, there are at least two differences :
__DIR__only exists with PHP >= 5.3dirname(__FILE__)is more widely used__DIR__is evaluated at compile-time, whiledirname(__FILE__)means a function-call and is evaluated at execution-time__DIR__is (or, should be) faster.As, as a reference, see the Magic constants section of the manual (quoting) :