Consider the following:
Demo1:
Run it.
Demo2:
Run it.
With ColdFusion 9 local is supposed to be private to the method. In Demo 2 the code behaves as expected but in Demo 1 the local in the variables scope is over written.
I consider this a bug with the local scope but I'd like some feed back.
BTW how did I find this? A friend on mine had code similar to the example and was wondering why local went blank half way through a page. I tracked it back to a UDF that had:
cfset local = {}
OK so calling a variable in a .cfm local not all the common but it could ( and did ) happen.
Thoughts?
27 comments: