Jump to content

Function Returning by Reference


terryds

Recommended Posts

What's the difference between

 

function &return_fish() {
$fish = "Fish";
return $fish;
}
$fish_ref =&return_fish();
And
function return_fish() {
$fish = "Fish";
return $fish;
}
$fish_ref = return_fish();
I see that the first one is returning by reference...
But, i don't understand what 'returning by refence' means... I'm sorry i'm not so good at English
Can you give me an example to show that they are different ?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...