eval() And __FILE__

../_images/eval_and__FILE__.png

__FILE__ is a magic constant that holds the current file full path. This is not true when using it inside eval(), which comes with an extra suffix that tell it is executed in eval(). In fact, eval() has its own __FILE__, since it is executed in a sandboxed and temporary area.

See Also

PHP Features