Back in the day when I was just learning to program, I wrote a BBcode library in JavaScript. Not knowing any better, I made very liberal use of globals throughout my code.
I later went to go port my code to PHP 4 (that was current at the time). To my surprise I was getting all these errors about how crappy of a programmer I was (both from globals and from misspellings and related problems).
I'm honestly not sure how people hate PHP so hard and yet don't mind JavaScript.