Whats the ampersand for?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Borojimmy
Forum Newbie
Posts: 12
Joined: Fri Mar 20, 2009 2:08 pm

Whats the ampersand for?

Post by Borojimmy »

Ive just been sent an example of an xml-rpc app,

when loooking through the app Ive noticed that the functions have an ampersand in them:


Code: Select all

function & functionName(param1, param2)
{
//do something here...
}
what is the

Code: Select all

&
used for?


thanks in advance


Jimmy
User avatar
MindOverBody
Forum Commoner
Posts: 96
Joined: Fri Aug 06, 2010 9:01 pm
Location: Osijek, Croatia

Re: Whats the ampersand for?

Post by MindOverBody »

An ampersand before a function name means the function will return a reference to a variable instead of the value
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Whats the ampersand for?

Post by AbraCadaver »

mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply