Another warning about CFCs

Tom Muck wrote a good blog entry today talking about weirdness he say when he did a structCopy() operation on a CFC. To me, this was obviously a misunderstanding. CFCs aren’t structs. But, like I mentioned in my post a few days ago, it can be confusing. My earlier entry mentioned how duplicate used to work on CFCs, but it returned something that wasn’t really a CFC. It seems like structCopy has the same issues. You can see this clearly if you dump a CFC and compare it to the dump of a structCopied CFC.

So - remember - you can’t duplicate or structCopy a CFC. Duplicate will throw an error in recent versions. StructCopy, unfortunately, will not. I’m going to file a bug report on this now.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments