Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are ColdFusion objects passed by reference or by value?

Are ColdFusion objects (i.e. CFCs invoked via cfobject) normally passed by reference or by value (copied in memory)? And is it possible to force ColdFusion to pass an object in either manner?

like image 548
Soldarnal Avatar asked Oct 20 '08 19:10

Soldarnal


2 Answers

ColdFusion objects are passed by reference. There's not really a way to pass an object by value, but you can create a copy using the duplicate() function.

like image 89
Patrick McElhaney Avatar answered Oct 19 '22 22:10

Patrick McElhaney


Well, keep in mind that using duplicate() doesn't work in MX 7 for copying certain things, like CFCs and COM, CORBA, and Java objects. You can copy a CFC in CF 8, though.

like image 15
Dave DuPlantis Avatar answered Oct 19 '22 22:10

Dave DuPlantis