In PHP why does capturing a function (which executes an echo statement) in a variable automatically print it without using echo? I'm sure i'm missing a fundamental truth about functions, but for the life of me I can't work this out.
when I've defined variables before, the value only prints to browser/terminal if I use echo, e.g.
$value = 3;//doesn't print anything as just defining the variable
echo $value;//prints 3 as have used echo
but if I assign a function (which itself executes an echo statement) to a variable, the act of assigning automatically prints the echo statement, e.g.
function number()
{echo "3";}
$number = number(); // Prints: 3
Does anybody have any idea what I'm trying to get at or am I talking gibberish?