Hi,
Is __FILE__ depreciated?
Am I correct in thinking that it contains the current scripts absolute path and when its dirname(__FILE__) it shows the absolute path to the directory in which the current script is?
Thanks.
| SitePoint Sponsor |



Hi,
Is __FILE__ depreciated?
Am I correct in thinking that it contains the current scripts absolute path and when its dirname(__FILE__) it shows the absolute path to the directory in which the current script is?
Thanks.
What makes you think its deprecated?

No, he thinks its depreciated.
like __FILe__ or something, maybe its linked to the UK pound.![]()
dirname( __FILE__ ) === __DIR__ in PHP 5.3![]()
If __FILE__ is meant to be deprecated what would be best alternate of it then?



All i asked was whether or not __FILE__ was depreciated.
I asked it because in i've never come across it during my time learning PHP.

you might be interested in magic constants then, and core predefined constants, which includes my favourite
PHP_EOL
(PHP End Of Line)
Which puts in the correct EOL for your OS.
echo 'a line' . PHP_EOL ;
I find it far better than "\n"; once I remembered to use it of course.



ok, thanks guys.
Bookmarks