What does this OOP operator mean?

software development

#1

Excuse the dumb question, but I can’t find a straight answer for this:

What does “=&” refer to ?

See this example:
$db =& JFactory::getDB0();

I’m trying to write a Joomla component, and noticed this is a common notation…


#2

That is a “reference” in PHP. You can learn more about what they are and how they work on php.net:

http://us3.php.net/manual/en/language.references.php
http://us3.php.net/manual/en/language.references.whatdo.php

–rlparker


#3

Thanks, rl. That makes sense.


#4

Your welcome, though I’m not sure how much “sense” it makes (being an “old guy”, it takes me a while to grasp some of these concepts!) :wink:

–rlparker