note 51989 added to function.func-get-args
| From: | theodore at websitters dot com | Date: | Mon, 18 Apr 2005 05:38:45 +0000 |
| Subject: | note 51989 added to function.func-get-args | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88143@lists.php.net to get a copy of this message | ||
Actually, that last example doesn't work fully, since without $i explicitly defined as starting
at 0, it instead starts at 1 (for whatever reason). So the first argument is never processed,
leading to serious problems. A better version is as follows:
<?php
function mutator($args) {
$n = count($args);
for ($i = 0; $i < $n; $i++) $args[$i] = 'howdy';
}
$a = "hello";
$b = "strange";
$c = "world";
mutator(array(&$a, $b, $c));
echo "$a $b $c";
?>
----
Manual Page -- http://www.php.net/manual/en/function.func-get-args.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51989
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51989&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51989&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51989&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51989&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51989&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51989&report=yes
Search -- http://master.php.net/manage/user-notes.php