What's the benefit of function refrence?

Posted by SpawnCxy on Stack Overflow See other posts from Stack Overflow or by SpawnCxy
Published on 2010-03-16T11:31:16Z Indexed on 2010/03/16 11:36 UTC
Read the original article Hit count: 144

Filed under:

When I reading the code of CodeIgniter,I found some functions written as follows:

function &get_instance()
{
   global $CI, $OBJ;

   if (is_object($CI))
   {
       return $CI;
   }

   return $OBJ->load;
}

I can understand variable refrence,but I can hardly get this through.Is it necessary to use this function style?And any benefit?

Thanks.

© Stack Overflow or respective owner

Related posts about php