|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-13 20:33 UTC] nikic@php.net
[2012-04-13 20:33 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
[2012-04-14 02:59 UTC] aharvey@php.net
-Status: Closed
+Status: Wont fix
-Assigned To: nikic
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 09:00:02 2025 UTC |
Description: ------------ I'd like common library writing were as clean as possible regarding includes. The problem is that "files for including are first looked in include_path relative to the current working directory and then in the directory of the current script", and not the other way round, thus forcing the programmer to write a dirty absolute path, which attemtpts against maintainability. A possible solution would be that if the include argument starts with a dot (.), then maintain current behaviour, else, look in script's directory first. Reproduce code: --------------- File /test.php (run this): <?php include('lib/test2.php'); echo "/test.php<br>"; ?> --------------- File /lib/test2.php: <?php include('test.php'); //Intends to include /lib/test but includes /test.php echo "/lib/test2.php<br>"; ?> --------------- File /lib/test.php: <?php echo "/lib/test.php<br>"; ?> Expected result: ---------------- /lib/test.php /lib/test2.php /test.php Actual result: -------------- Fatal error: Maximum function nesting level of '100' reached, aborting! /lib/test2.php on line 2