Bug #13315: problem with function definitions
| From: | php at altemachtige dot reageerttochniet dot nl | Date: | Sat, 15 Sep 2001 09:11:56 +0000 |
| Subject: | Bug #13315: problem with function definitions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-65995@lists.php.net to get a copy of this message | ||
From: php@altemachtige.reageerttochniet.nl
Operating system: WIN98/APACHE1.3.19
PHP version: 4.0.4pl1
PHP Bug Type: *General Issues
Bug description: problem with function definitions
<?php
$foo = 'foo';
function showvar( $bar = $foo )
{
//global $foo
//doesn't work either
echo $bar;
}
showvar();
showvar('bar');
?>
gives me a parse error on line 3:(
also:
<?php
$foo = 'foo';
function returnvar()
{
global $foo;
return $foo;
}
function whatisvar( $bar = returnvar() )
{
echo $bar;
}
?>
gives me this:
Parse error: parse error, expecting `')'' in c:/path/to/script/test.php on
line 9
Should work, shouldn't it?
--
Edit bug report at: http://bugs.php.net/?id=13315&edit=1