|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-10 12:55 UTC] sniper@php.net
[2007-01-22 23:12 UTC] didou@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 10:00:01 2025 UTC |
Description: ------------ In the reproduce code we include a file "test.php" showing 'Hello World' six times: - Outside a destructor: "test.php" - Outside a destructor: "D:\server\www\test\test.php" (full path) - Outside a destructor: "./test.php" These three cases work. We don't change include path and try them in a destructor: - Outside a destructor: "test.php" - works - Outside a destructor: "D:\server\www\test\test.php" (full path) - works - Outside a destructor: "./test.php" - No such file or directory, even if the file exists. Outside a destructor, PHP parses correctly the include path, inside it seems to be broken, because a fatal error is generated. PHP manual doesn't explain why the last case doesn't work, I also can't find any reason. I hope you'll fix it quickly. ---Configuration--- Windows XP SP 2 (NTFS) PHP 5.1.2 Apache 2.0.55 Ze1.compatibility = 0 Include path = .;C:\php5\pear (PHP 5 default) Safe mode = off Reproduce code: --------------- test.php: <?php echo 'Hello world!<br/>'; ?> problem.php: <?php require('test.php'); require('D:\server\www\test\test.php'); require('./test.php'); class foo{ function __destruct() { require('test.php'); require('D:\server\www\test\test.php'); require('./test.php'); } } $foo = new foo; ?> Expected result: ---------------- Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Actual result: -------------- Hello world! Hello world! Hello world! Hello world! Hello world! Warning: foo::require(./test.php) [function.require]: failed to open stream: No such file or directory in D:\server\www\test\problem.php on line 11 Fatal error: foo::require() [function.require]: Failed opening required './test.php' (include_path='.;C:\php5\pear') in D:\server\www\test\problem.php on line 11