In PHP, all object-variables are actually pointers to objects (no?), the language handles this implicitly (right?), yet I see many php code specifying references in parameters such as this:
function someMethod(SomeClass& $obj)
{
//...
}
I've also seen things like this:
function add()
{
$object = new SomeClass;
self::$objects[] =& $object;
}
Correct me if I'm wrong, but there wouldn't be any difference here:
self::$objects[] =& new SomeClass
self::$objects[] = new SomeClass
Am I right??????
Another thing I tested:
class SomeClass{}
$obj =& new SomeClass; // is in fact deprecated, doesn't work
$obj = new SomeClass;
$obj2 =& $obj; // works, but should also be deprecated!! No?