CodeIgniter Forums
what is the use of the ampersand added to the front of the function call - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: what is the use of the ampersand added to the front of the function call (/thread-40317.html)



what is the use of the ampersand added to the front of the function call - El Forum - 04-05-2011

[eluser]Unknown[/eluser]
Hi,
I read the CodeIgniter source code,found the is_loaded function defined in the Common.php file,as follow
function is_loaded($class = '')

And that function is called in Controller.php file:
$this->load->_base_classes =& is_loaded();
my question is why add the ampersand to is_loaded(),i think it is useless


what is the use of the ampersand added to the front of the function call - El Forum - 04-05-2011

[eluser]InsiteFX[/eluser]
It creates a reference to that object.

PHP.net - Passing by Reference

InsiteFX