ColdFusion compiler is broken

Following on a tweet from Sean Corfield, I couldn’t believe it is possible to create a function called if, else, while and so on as well as declare variable called var. Here is the code that may hurt your head:

[sourcecode lang="cf"]
<cffunction name="if">
	<cfargument name="val1" />
	<cfargument name="val2" />
	<cfif val1 eq val2>
		<cfreturn true />
	</cfif>
	<cfreturn false />
</cffunction>
<cffunction name="hello">
	<cfset var var = 2 />
	<cfreturn var />
</cffunction>
<cfif if( hello(), 2 )>
	LOL
</cfif>
[/sourcecode]

How cool is that ;)

2 Responses to “ColdFusion compiler is broken”

  1. CFNeutral Says:

    If that’s considered broken then its also broken in Railo.

  2. radekg Says:

    I don’t have Railo, I could test only with CF but good to know :)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>