#19252 [Opn->Fbk]: function only accepts scalars or constants as default values
| From: | kalowsky@php.net | Date: | Thu, 05 Sep 2002 20:22:54 +0000 |
| Subject: | #19252 [Opn->Fbk]: function only accepts scalars or constants as default values | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-18518@lists.php.net to get a copy of this message | ||
ID: 19252
Updated by: kalowsky@php.net
Reported By: jc@mega-bucks.co.jp
-Status: Open
+Status: Feedback
Bug Type: Documentation problem
Operating System: Red Hat Linux 7.2
PHP Version: 4.2.2
New Comment:
No it wouldn't be nice to do #2, thats just not fun programming
practice/maintaince.
Can you give a URL to the section of the documentation you're asking to
be updated?
Previous Comments:
------------------------------------------------------------------------
[2002-09-05 11:09:23] jc@mega-bucks.co.jp
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 this bug report at http://bugs.php.net/?id=19252&edit=1