#19252 [NEW]: function only accepts scalars or constants as default values
| From: | jc at mega-bucks dot co dot jp | Date: | Thu, 05 Sep 2002 16:09:23 +0000 |
| Subject: | #19252 [NEW]: function only accepts scalars or constants as default values | ||
| Groups: | php.bugs php.doc | ||
| Request: | Send a blank email to php-bugs+get-18497@lists.php.net to get a copy of this message | ||
From: jc@mega-bucks.co.jp
Operating system: Red Hat Linux 7.2
PHP version: 4.2.2
PHP Bug Type: Documentation problem
Bug description: function only accepts scalars or constants as default values
Could you add to the docs in the section on functions and default argument
values that default values can only be scalers or constants?
these won't work:
1- function a ($b = $val) {}
2- function b ($a = another_function()) {}
This link offers some workarounds, eventhough it would be really nice to
be able to do #2, don't you think ;)
http://marc.theaimsgroup.com/?l=php-general&m=91877248424055&
--
Edit bug report at http://bugs.php.net/?id=19252&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19252&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19252&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19252&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19252&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19252&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19252&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19252&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19252&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19252&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19252&r=globals