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");
?>
[Back to original message]
|