title: Use define constant in another file
body: <p>I have a small piece of code that was written in previous version of PHP (not 5.3) and I find it odd for the interpreter to catch a cross use of a constant as a notice message then finally cough up a fatal error when the constant is defined in a file that is different from the one the notice is being reported.
  That is, for example, I define my constant in file A which is initialized when the program starts</p>
  
  <pre><code>define('SOME_CONSTANT','something');
  </code></pre>
  
  <p>and in file B.php</p>
  
  <pre><code>require_once('A.php');
  Call-function-that-uses-fileA's-SOME_CONSTANT
  </code></pre>
  
  <p>File B is reported with notice message and a fatal error.</p>
  
  <p>The fatal error can be roughly described as </p>
  
  <blockquote>
    <p>require_once() [function.require]: Failed opening required ....</p>
  </blockquote>
  
  <p>in which "...." stands for a long line of included paths that may or maynot be related to the current file B at all. I am grateful for any help or advice you offer. </p>
  
  <p>Is this caused by my use of new PHP version while my code was written in old one ? How can I fix these messages without reinstalling the PHP ? </p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>The only reason I would not want to reinstalling the PHP is that because I don't want to always change the PHP whenever I have to work with a new project. Now it may be old, what if later I need to use the latest version, re-downloading the new one and deleting the old one psss?</p>