You are here: Re: References « PHP Programming Language « IT news, forums, messages
Re: References

Posted by Vince Morgan on 05/07/07 14:14

"Vince Morgan" <vinharAtHereoptusnet.com.au> wrote in message
news:463f3216$0$15845$afc38c87@news.optusnet.com.au...
> <?
> function &get()
> {
> global $r;
> return $r;
> }
> $r=5;
> $var=$r;
> echo $var;//output is 5 as expected.
> $r=6;
> echo $var;//output is still 5 as not expected, by me that is ;)
> $var=$r;
> echo $var;//output is now 6
> ?>

Oooops, getting too late evidently. I meant to write the following.
<?
function &get()
{
global $r;
return $r;
}
$r=5;
$var=get();
echo $var;//output is 5 as expected.
$r=6;
echo $var;//output is still 5
$var=get();
echo $var;//output is now 6
?>

 

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

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