You are here: Re: [PHP] php5 call by refference « PHP « IT news, forums, messages
Re: [PHP] php5 call by refference

Posted by Marcus Bointon on 10/14/85 11:32

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@synchromedia.co.uk | http://www.synchromedia.co.uk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация