| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2005-05-03 11:35 UTC] stas at zend dot com
 Description:
------------
At least starting from 4.3.x, when file is included via include(), it is added to the list of included files, so that the code:
<? include('foo'); include_once('foo'); ?>
woould include 'foo' only once.
However, if you put foo in auto_prepend_file and then do <? include_once('foo'); ?> - 'foo' would be included twice.
I see this behaviour as inconsistent and needing to be fixed, though there can be some BC issues with that. 
Reproduce code:
---------------
1. 
<? include('foo'); include_once('foo'); ?>
foo:
<? echo "Whatever..."; ?>
2.
auto_prepend_file=foo
<? include_once('foo'); ?>
Expected result:
----------------
"Whatever..." once in both cases
Actual result:
--------------
"Whatever..."  once in the first case, twice in the second.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 14:00:01 2025 UTC | 
IMO, the following SHOULD include the file twice: <? include('foo'); include_once('foo'); ?> normal includes should not get their file names put into the included_files list... only ones that are included with include_once/require_once. So I think you fixed the bug in the wrong way here.