Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Functions?

1 view
Skip to first unread message

Abu Hafs

unread,
Mar 29, 2005, 7:10:55 PM3/29/05
to
Hello,

I just signed up for this google group with the hope that i will get
some help out here. I was looking into a source code given to me in
the office but i was unable to understand this funcion declaration,
can any body please help me

function & query ($sQuery) {
global $default;
$aParams = array();
if (is_array($sQuery)) {
$aParams = $sQuery[1];
$sQuery = $sQuery[0];
}

What is the & symbol is about in this code.

Thanks

Norman Peelman

unread,
Apr 3, 2005, 7:44:04 AM4/3/05
to
The '&' symbol normal refers to passing a value by 'reference' (not a
copy) and is normally used like so:

function query(&$sQuery)
{
...
}

I've never seen it in front of a function name before. You'll find alot
more help in the newsgroups 'alt.php' and 'alt.comp.lang.php'

Norm
--
FREE Avatar hosting at www.easyavatar.com

"Abu Hafs" <abu...@gmail.com> wrote in message
news:c9f5db6b.05032...@posting.google.com...

the Big H

unread,
Oct 19, 2009, 2:27:07 AM10/19/09
to

If you put an ampersand before your function name, the function will
return a reference to a variable instead of the value.

------------------------------------
The Developer Network
http://thedevnet.com

0 new messages