Hello im interested in understanding how variables are stored in php.
say i have two variables
$p = 1 + 1
$b = $p.
Does php save the result of the variable or does it save the procedure to run it? Why im wondering is if i store a function in it, does it store the return value or just copies the procedure.
Thank you!
Edit: I think it be best if i clarified what im talking about.
say:
function foo($something)
{
for loop
{
echo 'Something';
}
return $something;
}
$b = foo(5);
echo $b;
from what i encountered just assigning the value executes the function. And when i echo $b it also executes the function again.