tracker issue : CF-3043459

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 86496:Summary: CF creates spurious variable "___IMPLICITARRYSTRUCTVAR0"See steps to reproduce

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/26/2011

Components: Language, Datastructure

Versions: 10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,1,274733 / 279963

Priority/Frequency: Trivial / Most users will encounter

Locale/System: English / Win All

Vote Count: 5

Problem:

Summary: CF creates spurious variable "___IMPLICITARRYSTRUCTVAR0"See steps to reproduce.  When one runs this code with ?BUNG=TRUE on the URL, one sees that CF creates this "___IMPLICITARRYSTRUCTVAR0" variable in the variables scope.  This only happens in CFM files (not CFC files).  However if a CFC method includes a CFM (less than ideal, I know, but there's a good reason we're doing this), then the variable is created in the CFCs VARIABLES scope.  If this CFC is a singleton... this could have potential for collisions under load?  Not sure.  Anyway, if using structNew() doesn't need to create this variable; nor should {}.  Equally, this is new to CF9, so if CF8 didn't need it, then you simply shouldn't be doing it. -- Adam
Method:

<cfif structKeyExists(URL, "bung") AND URL.bung>    <cfset st = {        foo = "bar"    }><cfelse>    <cfset st = structNew()>    <cfset st.foo = "bar"></cfif><cfloop item="sKey" collection="#variables#">VARIABLES.<cfoutput>#sKey#</cfoutput> found.  Value:<br />    <cfdump var="#variables[sKey]#" label="#sKey#">    <hr /></cfloop><cfdump var="#variables#" label="variables">
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3043459

External Customer Info:
External Company:  
External Customer Name: Adam Cameron
External Customer Email: 17EB1A7649DA54C7992015A9
External Test Config: 02/26/2011

Attachments:

Comments:

Creating variables without the developer knowing is criminal. It is not like this is an oversight as cfdump specifically hides them, you can only find it by looping through the scope. This should be fixed.
Vote by External U.
21156 | November 11, 2011 07:35:52 AM GMT
This bug has been voted..
Vote by External U.
21157 | November 11, 2011 07:35:53 AM GMT
This bug has been voted..
Vote by External U.
21158 | November 11, 2011 07:35:53 AM GMT
This bug has been voted..
Vote by External U.
21159 | November 11, 2011 07:35:54 AM GMT
I do recall seeing that stuff while debugging. +1 for removing it.
Vote by External U.
21160 | November 11, 2011 07:35:55 AM GMT