start.php
<?php
if(file_exists('/config.php')) require_once('/config.php');
echo TEST;
?>
config.php
<?php
define('TEST','Hamsters');
?>
I have Windows XP + XAMPP with PHP Version 5.3.8.
If I run start.php it gives me this error:
Notice: Use of undefined constant TEST - assumed 'TEST' in C:\programs\xampp\htdocs\start.php on line 3
Now I modify start.php to the following and he gives me my Hamsters
:
<?php
require_once('/config.php');
echo TEST;
?>
How can file_exists()
say the file not exist but without the condition still be able to require_once()
the file that claimed non-existent?