|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-09-05 11:09 UTC] jc at mega-bucks dot co dot 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&
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Yeah, we may as well mention this here: file: phpdoc/{lang}/language/functions.xml section: <sect2 id="functions.arguments.default">