note 42560 deleted from language.references.pass by betz
| From: | betz@php.net | Date: | Fri, 21 May 2004 14:35:13 +0000 |
| Subject: | note 42560 deleted from language.references.pass by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69910@lists.php.net to get a copy of this message | ||
Note Submitter: wechsler!phase,org
----
Unfortunately you don't appear to be able to use default argument values when passing by
reference, so you can't make pass-by-reference arguments optional.
eg, you can write:
<?php
function secondargoptional($something,$otherthing='default') { ... }
?>
or
<?php
function secondargbyreference($something,&$otherthing) { ... }
?>
but not
<?php
function secondargopptionalbyreference($something,&$otherthing='default') { ... }
?>
(In PHP 4.3.4 at least)
Anyone got a workaround, or care to prove me wrong?