note 51989 deleted from function.func-get-args by bjori

From: Date: Tue, 25 Apr 2006 19:09:07 +0000
Subject: note 51989 deleted from function.func-get-args by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-109671@lists.php.net to get a copy of this message
Note Submitter: theodore at websitters dot com ---- 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"; ?>

« previous php.notes (#109671) next »