php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37766 include_once() adds file more than one time
Submitted: 2006-06-09 15:37 UTC Modified: 2006-10-04 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: boris_k at iname dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5CVS-2006-06-09 (snap) OS: win2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: boris_k at iname dot com
New email:
PHP Version: OS:

 

 [2006-06-09 15:37 UTC] boris_k at iname dot com
Description:
------------
File inc/test3.inc included in code more then one time.

php is module of apache 2.2

php.ihi is here http://bdr.kiev.ua/tmpboris/php.ini till some time.

ICQ 176869864

Good luck! 


Reproduce code:
---------------
File test.php
<?php
include_once('inc/test3.inc'); // it have to print array
include_once('inc/test3.inc'); // no output
include_once('inc/test3.inc'); // no output
include_once ('inc/test2.inc'); // 
?>

File inc/test2.inc
<?php include_once ("test3.inc"); ?> 

File inc/test3.inc
<?php
echo "file inc/file3.inc\n";
print_r(get_included_files ( )); 
?>

Expected result:
----------------
file inc/file3.inc
Array
(
    [0] => C:\tmp\bdr\html\php\test.php
    [1] => C:\tmp\bdr\html\php\inc\test3.inc
)


Actual result:
--------------
file inc/file3.inc
Array
(
    [0] => C:\tmp\bdr\html\php\test.php
    [1] => C:\tmp\bdr\html\php\inc\test3.inc
)
file inc/file3.inc
Array
(
    [0] => C:\tmp\bdr\html\php\test.php
    [1] => C:\tmp\bdr\html\php\inc\test3.inc
    [2] => C:\tmp\bdr\html\php\inc\test2.inc
    [3] => c:\tmp\bdr\html\php\inc\test3.inc
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-26 22:13 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-10-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-03-21 22:32 UTC] jim_janer at hotmail dot com
I am using XAMPP and include_once reads more than once every time I read again the same PHP file. Is this the same bug?
 [2009-03-24 09:43 UTC] boris_k at iname dot com
in php 5.2.6 all works well.

Thank you for fix.

Close this topic, please.

Boris.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 21:01:35 2025 UTC