Bug #15793 Updated: inconsistent behaviour for __FILE__ constant
| From: | pb at no_spam_please dot pebe dot net | Date: | Thu, 28 Feb 2002 22:00:25 +0000 |
| Subject: | Bug #15793 Updated: inconsistent behaviour for __FILE__ constant | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-1325@lists.php.net to get a copy of this message | ||
ID: 15793
Updated by: pb@no_spam_please.pebe.net
Reported By: jas@cs.yorku.ca
Status: Open
Bug Type: Scripting Engine problem
Operating System: Solaris 8
PHP Version: 4.1.2
New Comment:
I'm experiencing the exact same problem, and it's making horde/imp a
no-go. The new horde 2.0 and imp 3.0 is using __FILE__ everywhere in
the code, and due to this bug it just won't work without modifying a
lot of the code.
/pb
Previous Comments:
------------------------------------------------------------------------
[2002-02-28 16:00:08] jas@cs.yorku.ca
__FILE__ constant behaviour in PHP seems to have some problems that are
Solaris specific, and some problems that are just general.
Put the following in a file "test.php":
<?php
echo "file " . __FILE__;
?>
Try:
php test.php
The expected result is:
file <path to test.php>/test.php
The result on both Linux and Solaris PHP is:
file test.php
Now call the same php script VIA the web. The result will be the
expected "file <path to test.php>/test.php" on both Linux and Solaris.
If this isn't a bug, it seems like maybe an inconsistency in PHP
behaviour under different operating modes.
However, the problems continue.
Change the original test.php script above to:
<?php
echo "file " . __FILE__ . " ";
require_once './tmp/test1.php';
?>
And in tmp/test1.php put the following:
<?php
echo "file " . __FILE__;
?>
Access test.php VIA the web.
I expect to see:
file /cs/home/jas/www//test.php file /cs/home/jas/www/tmp/test1.php
On Linux that's what you'll see.
On Solaris, I see:
file /cs/home/jas/www/test.php file /tmp/test1.php
If I specify a full path to "tmp/test1.php" --
/cs/home/jas/www/tmp/test1.php, then the result is as expected.
What's going on with __FILE__? Am I misunderstanding its use?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15793&edit=1