eval() And FILE
<?php
eval(' echo "__FILE__ is not `'.__FILE__.'` in `" . __FILE__."`"; ');
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
- FILE in eval() [Try me]
PHP Features
Last updated: 10 September 2026