NYCPHP Meetup

NYPHP.org

[nycphp-talk] What does function &get_ref() {} do?

Michael Southwell southwell at dneba.com
Wed Sep 3 09:03:50 EDT 2003


Here is the relevant portion of Jon's reference (illustrating &$var):
-------------------------
function swap(&$var_1, &$var_2)
{
   $temp = $var_1;
   $var_1 = $var_2;
   $var_2 = $temp;
}

$var_1 = 'I am var 1';
[etc]
-----------------------------

doesn't this need global $var_1,$var_2; in the swap function?


At 01:42 AM 9/3/2003, you wrote:
>this explains it pretty well ...
>
><http://www.faqts.com/knowledge_base/view.phtml/aid/134/fid/40>http://www.faqts.com/knowledge_base/view.phtml/aid/134/fid/40
>
>- jon
>----- Original Message -----
>From: <mailto:soazine at erols.com>Phil Powell
>To: <mailto:talk at lists.nyphp.org>NYPHP Talk
>Sent: Wednesday, September 03, 2003 3:16 AM
>Subject: [nycphp-talk] What does function &get_ref() {} do?
>
>I've seen the notation '&' floating around prefixing function names from 
>time to time but I can't find any online resource that explains what it 
>does.  Can someone explain it to me?
>
>Thanx
>Phil
>
>
>----------
>_______________________________________________
>talk mailing list
><mailto:talk at lists.nyphp.org>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk

Michael G. Southwell =================================
DNEBA Enterprises
81 South Road
Bloomingdale, NJ 07403-1419
973/492-7873 (voice and fax)
southwell at dneba.com
http://www.dneba.com
======================================================





More information about the talk mailing list