#25658 [Opn->Csd]: Problem with get_included_files
| From: | kennyt@php.net | Date: | Thu, 15 Jan 2004 00:23:13 +0000 |
| Subject: | #25658 [Opn->Csd]: Problem with get_included_files | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969358184@lists.php.net to get a copy of this message | ||
ID: 25658
Updated by: kennyt@php.net
Reported By: gms08701 at yahoo dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: FreeBSD 4.8-RELEASE-p3
PHP Version: 4.3.3
New Comment:
verified in 4.3.4 and 5.0b3.
Previous Comments:
------------------------------------------------------------------------
[2004-01-14 17:52:52] matbtt at web dot de
> It's correct behaviour, manual is wrong.
I faced the problem after my provider updated to 4.3.4 and I can't
believe that this should be the correct behaviour. The function's name
is get_included_files and this is what it should return and has
returned in 4.2.2 for example.
------------------------------------------------------------------------
[2003-09-25 13:23:33] sniper@php.net
It's correct behaviour, manual is wrong.
------------------------------------------------------------------------
[2003-09-25 12:32:16] gms08701 at yahoo dot com
Description:
------------
Using get_included_files() function returns an array of
included/required files *plus* the file being accessed via the url.
When reading the manual ->
Returns an array of the names of all files that have been included
using include(), include_once(), require() or require_once()
So going strictly by that, this extra file shouldn't be in the result
array.
I came across similar reports in the bugs database, but they all
suggest that the problem was fixed.
Thanks for your time
Reproduce code:
---------------
a.php
----
<?php
?>
b.php
----
<?php
include('./a.php');
var_dump(get_included_files());
?>
Expected result:
----------------
When viewing b.php, I should be getting ->
array(1) { [0]=> string(27) "/files/www/data/crash/a.php" }
Actual result:
--------------
When viewing b.php, Im getting ->
array(2) { [0]=> string(27) "/files/www/data/crash/b.php" [1]=>
string(27) "/files/www/data/crash/a.php" }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25658&edit=1