Doc #51569 [Com]: Documentation of include missing fallback to calling script's cwd

From: Date: Wed, 15 Sep 2010 01:30:31 +0000
Subject: Doc #51569 [Com]: Documentation of include missing fallback to calling script's cwd
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5036@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51569&edit=1 ID: 51569 Comment by: mail_ben_schmidt at yahoo dot com dot au Reported by: privat at ni-po dot com Summary: Documentation of include missing fallback to calling script's cwd Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N New Comment: This appears to be a regression from bug #41460 where the documentation included this fact and was clarified to ensure the behaviour was properly described. See also bug #52845 for another documentation deficiency related to include and include_path, and bug #52847 for what I think is a documentation problem, but may be a behaviour problem. Previous Comments: ------------------------------------------------------------------------ [2010-09-15 02:15:55] mail_ben_schmidt at yahoo dot com dot au Just to clarify, we're saying here that when you do include($relative_path) PHP falls back to trying the equivalent of include(dirname(__FILE__).DIRECTORY_SEPARATOR.$relative_path) aren't we? I.e. it checks relative to the location of the current script, not relative to the current working directory (that behaviour is already documented, though perhaps not well). ------------------------------------------------------------------------ [2010-05-22 19:44:30] privat at ni-po dot com Now *really* updated it... ------------------------------------------------------------------------ [2010-05-22 19:43:30] privat at ni-po dot com Updated bug type and php version ------------------------------------------------------------------------ [2010-04-16 14:00:30] privat at ni-po dot com Description: ------------ The documentation of include (http://php.net/manual/en/function.include.php) is missing an important fact: If PHP cannot identify the filename as a stream wrapper, a relative or absolute path and cannot find filename in one of the include paths, it will fall back to the calling script's current working directory. See http://svn.php.net/viewvc/php/php-src/trunk/main/fopen_wrappers.c?view=markup on lines 602 - 638. I spent some nice hours to find that out, I think it really should be a documented feature. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51569&edit=1

« previous php.doc.bugs (#5036) next »