php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25658 Problem with get_included_files
Submitted: 2003-09-25 12:32 UTC Modified: 2004-01-14 19:23 UTC
From: gms08701 at yahoo dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.3 OS: FreeBSD 4.8-RELEASE-p3
Private report: No CVE-ID: None
 [2003-09-25 12:32 UTC] 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" }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-25 13:23 UTC] sniper@php.net
It's correct behaviour, manual is wrong.

 [2004-01-14 17:52 UTC] 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.
 [2004-01-14 19:23 UTC] kennyt@php.net
verified in 4.3.4 and 5.0b3.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC