I want to write a function (as I have written in several other languages) that
obtains it's arguments dynamically (using func_get_arg()) and then assigns to that
argument. Think of the way that scanf() works -- that sort of thing.

I have distilled what I want to do in the code below. foo adds 1 to all of it's 

function foo () {
        $count = func_num_args();
        for($i = 0; $i <= $count; $i++) {
                $var = func_get_arg($i);
                // The following line should do it, but throws a syntax error
                &$var = $var + 1;

$a = '1';
$b = '2';
$c = '3';

foo($a, $b, $c);

What I am doing is quite different than the above (and more complex), but I will be 
to achieve what I want if I can get the above to work.

Alain Williams

#include <std_disclaimer.h>

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to