From:             skissane at ics dot mq dot edu dot au
Operating system: Linux
PHP version:      4.3.4
PHP Bug Type:     Documentation problem
Bug description:  Documentation for $_SERVER["SCRIPT_FILENAME"] incorrect

Description:
------------
According to the documentation:
'SCRIPT_FILENAME'
The absolute pathname of the currently executing script. 

But, when I do 'echo $_SERVER["SCRIPT_FILENAME"]', using PHP-CLI, I get a
pathname relative to the current directory.

So either the docs are wrong, or the code is buggy (suggest that
documented behaviour is more useful than actual behaviour, hence code
should be changed.)

(Despite what the form forced me to say above, I'm actually using
4.3.4RC1, not 4.3.4, but I hope it makes no difference. Apologies if it
does.)

Reproduce code:
---------------
Make a directory called foo, under $HOME.
Put this file as test.php in $HOME:
<?
echo $_SERVER["SCRIPT_FILENAME"] . "\n";
Now cd to $HOME
Execute: php foo/test.php


Expected result:
----------------
<path to your home directory>/foo/test.php

Actual result:
--------------
foo/test.php

-- 
Edit bug report at http://bugs.php.net/?id=26429&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26429&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26429&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26429&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26429&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26429&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26429&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26429&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26429&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26429&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26429&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26429&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26429&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26429&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26429&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26429&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26429&r=float

Reply via email to