Re: php5 call by refference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21 Nov 2005, at 09:26, Georgi Ivanov wrote:

AFAIK, in PHP5 one can't call function with function parameters .
The error is that you only can pass variables by reference.
foo(strlen('aaa'),strlen('bbbb'));

You can call functions like that without problems UNLESS the function is expecting values by reference, i.e. results are passed back through the parameters. If you supply a function result, then you may as well not be calling the function as you'll never be able to get a result back from it, hence the error message. e.g.

function foo(&$a, $b) {
	$a = $a.$b;
}

If you call this as you asked, where would the result go?

Is there some sort of workaround ?

As was suggested, put your values in variables before calling the function, though the code example you posted suggests you're trying to do something odd.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux