|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-04-18 16:29 UTC] vovik at getart dot ru
Description:
------------
When script started and do require_once() by relative filename, this function remembers lower case real path.
If script changes working dir via chdir() and directory name consist of not lower-case letters, require_once() will include the file again.
Reproduce code:
---------------
<?php
// This file located under directory with non-lowercase name, i.e. "TesT"
print "<pre>";
require_once("./inc.php"); // single print line there
chdir("./..");
chdir("./TesT");
require_once("./inc.php");
var_dump(get_included_files());
?>
Expected result:
----------------
I expect to single include of inc.php.
Actual result:
--------------
Actually, got two :)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 00:00:01 2025 UTC |
I've pasted the reproduce code with php tags and it was stripped. Here is it: // This file located under directory with non-lowercase name, i.e. "TesT" print "<pre>"; require_once("./inc.php"); // single print line there chdir("./.."); chdir("./TesT"); require_once("./inc.php"); var_dump(get_included_files());