title: Include PHP file with condition opened but closed in another included PHP file
body: <p>I would like to include at the beginning of my script a PHP file that open a IF condition. Then i write my script, and to finish I include another PHP file that close the conditon.</p>
  
  <p>This bring me to a "Parse error: syntax error, unexpected end of file in ..." error.</p>
  
  <p>This will be better to understand with this simple example :</p>
  
  <p><strong>header.php</strong></p>
  
  <pre><code>if(aConditionalTest()) {
  </code></pre>
  
  <p><strong>footer.php</strong></p>
  
  <pre><code>} // endIf
  </code></pre>
  
  <p><strong>mypage.php</strong></p>
  
  <pre><code>include_once 'header.php';
  echo 'my awesome content';
  include_once 'footer.php';
  </code></pre>
  
  <p>FYI: I would like to do this for example : </p>
  
  <ul>
  <li>to check everywhere that a user is authorized before displaying the content</li>
  <li>implement a webpage caching system (see <a href="http://www.phpfastcache.com/" rel="nofollow">http://www.phpfastcache.com/</a> in "Example" section, "Caching Whole Webpage")</li>
  </ul>
  
  <p>THANKS!</p>
  
  <hr>
  
  <p><em>edit : Explain more precisely WHY I want to do this for using phpfastcache :</em></p>
  
  <p><a href="http://www.phpfastcache.com/" rel="nofollow">http://www.phpfastcache.com/</a> says :</p>
  
  <blockquote>
    <p>Caching Whole Webpage PHP Cache whole web page : 
    You can use phpFastCache to cache the whole webpage easy too. This is simple
    example, but in real code, you should split it to 2 files:
    cache_start.php and cache_end.php. <strong>The cache_start.php will store the
    beginning code until ob_start(); and the cache_end.php will start from
    GET HTML WEBPAGE.</strong> Then, your index.php will include cache_start.php on
    beginning and cache_end.php at the end of file.</p>
  </blockquote>
  
  <p>That's just what I try to do!
  According to their piece of code below, this brings to the situation where the condition is opened in "cache_start.php" and then closed in "cache_end.php"</p>
  
  <p><strong>cache_start.php</strong></p>
  
  <pre><code> use phpFastCache\CacheManager;
  
      $cache = CacheManager::Memcached();
  
      $keyword_webpage = md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].$_SERVER['QUERY_STRING']);
      // try to get from Cache first.
      $resultsItem = $cache-&gt;getItem($keyword_webpage)
  
      if(!$resultsItem-&gt;isHit()) {
          ob_start();
  </code></pre>
  
  <p><strong>cache_end.php</strong></p>
  
  <pre><code> // GET HTML WEBPAGE
          $html = ob_get_contents();
  
          $resultsItem-&gt;set($html)-&gt;expireAfter(1800);
          $cache-&gt;save($resultsItem);
      }
  
      echo $resultsItem-&gt;get();
  </code></pre>
  
  <p><strong>mypage.php</strong></p>
  
  <pre><code>include_once 'cache_start.php';
  // my awesome content to cache goes here...
  include_once 'cache_end.php';
  </code></pre>
  
  <p><strong>myotherpage.php</strong></p>
  
  <pre><code>include_once 'cache_start.php';
  // my other great content to cache goes here...
  include_once 'cache_end.php';
  </code></pre>
  
  <p>So the reason WHY I want to put the phpfastcache code in 2 separate files is that I have many different PHP pages to cache, so I would like to avoir repeating all this code on each page...</p>
  
  <p>Hope this edit will help you better understand why I would do that, even if I understood, as I feared, that is is not possible.</p>