From: crucifyer at korea dot com
Operating system: Gentoo Linux 1.4
PHP version: 4.3.4
PHP Bug Type: Documentation problem
Bug description: parse error : function funcname($val = $_SERVER['REQUEST_URI'])
Description:
------------
parse error in function's default value.
thanks.
Reproduce code:
---------------
class LinkManager
{
var $uri, $flag;
function LinkManager($uri = $_SERVER['REQUEST_URI']) // this line bug.
$uri = '' is ok. $uri = $_ is error. why not?
{
$this->uri = $uri;
if(strpos($uri, '?'))
$this->flag = '&';
else
$this->flag = '?';
return TRUE;
}
}
Actual result:
--------------
active code.
class LinkManager
{
var $uri, $flag;
function LinkManager($uri = '')
{
if($uri == '')
$this->uri = $_SERVER['REQUEST_URI'];
else
$this->uri = $uri;
if(strpos($uri, '?'))
$this->flag = '&';
else
$this->flag = '?';
return TRUE;
}
}
--
Edit bug report at http://bugs.php.net/?id=26693&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26693&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26693&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26693&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26693&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26693&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26693&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26693&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26693&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26693&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26693&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26693&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26693&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26693&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26693&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26693&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26693&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26693&r=float