Quantcast
Channel: Raymond Camden's Blog
Viewing all articles
Browse latest Browse all 302

This works... and it freaks me out

$
0
0

I just ran across a template that had an interesting typo. Here is an example.

component {

	{
		public function hello() {
			return "Hello";
		}

	}
	
}

See it? The function is surrounded by an extra pair of brackets. ColdFusion just hoists it up just like JavaScript, so I shouldn't be surprised, but wow did that freak me out a bit.

Then for the hell of it I went crazy - and yes - it still works.

component {

	{
		{
			{
				{
					{
						public function hello() {
							return "Hello";
						}
					}
				}
			}
		}
	}

}

Anyway... yeah... don't do this. ;)


Viewing all articles
Browse latest Browse all 302

Trending Articles