You are here: return a reference but it is a number, like 100 « PHP Programming Language « IT news, forums, messages
return a reference but it is a number, like 100

Posted by Summercool on 10/02/07 00:03

the following code will let foo() return a reference something, but
the thing being returned is a number. I thought there is no "alias"
to a number, only to a variable? Is returning of a reference mainly
for returning a big array or for returning an object in PHP4?

<pre>

<?php


function &foo(&$i) {
$i = 10;
return 100;
}

$j = 1;
print_r("$j\n");

$k = foo($j);
print_r("$j\n");

print_r("$k\n");

?>

 

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

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