Jump to content

instantiating object with "&new ObjectName();"?


arianhojat

Recommended Posts

Only place I seen & referenced in code before is when you want to pass a variable into a function that you want to modify...

What does it mean in this different context, before the instantiation of an object?:
$var = &new ObjectName();

an example of where i see this is here although to me it seems like it is not needed just to create the object: http://www.devshed.com/c/a/PHP/The-Basics-of-Serializing-Objects-in-PHP/1/
$dataSaver=&new DataSaver('This string will be saved to file');


thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/25311-instantiating-object-with-new-objectname/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.