Copy link to clipboard
Copied
In cf7 and cf8 if you do the following:-
<cffunction name="duplicateIssue" access="public" output="false" returntype="void" hint="">
<cfargument name="arg1" type="string" required="true" hint="">
<cfargument name="arg2" type="string" required="true" hint="">
<cfargument name="arg3" type="string" required="true" hint="">
<cfset var local = duplicate(arguments)>
<cfset var local2 = duplicate(arguments)>
<cfdump var="#local#">
<cfdump var="#local2#">
<cfabort>
</cffunction>
<cfset duplicateIssue()>
They will output the same. However, in CF9 the first assignment to local is ignored and the local scope is populated. This means that the current application I work on cannot be migrated to CF9, as there are lots of occurances where the arguments scope is being duplicated into a struct called local. I know why this was added in CF9 to make life apprently easier for people who don't like varring things but it has changed the behaviour quite drastically and will take a lot of chages and testing for me to upgrade.
Any advice would be greatly appreciated,
Simon
Copy link to clipboard
Copied
You could always be brave and try a global replacement of the word local to something else. You still have to test everything of course but wouldn't you be doing that anyway?
Copy link to clipboard
Copied
Yeah, I know I could do that. I was just trying to not end up doing something that drastic. It was an informatiojn gathering exercise. On further investigation it appears that if you assign anything to local it just ignores it, which is a total disaster. So you can't do this either:-
<cfset local = getProperties()>
It just totally ignores that line. I don't feel like this is much of a feature!