Answer the question
In order to leave comments, you need to log in
What's the point of function &bar()?
I'm reading the php documentation section "Passing by reference" I can't understand from just
<?php
function foo(&$var)
{
$var++; // 6
}
function &bar()
{
$a = 5;
return $a; // 5
}
foo(bar()); // кидаем 5 в foo
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question