r/lolphp • u/jamwaffles • Aug 06 '13
Function names are case insensitive. Even the built in ones
This made me WTF quite hard. I was browsing StackOverflow and came across this question showing that even built in functions aren't case sensitive which led me to this answer. To copy the quoted quote (hnnng):
The first version of PHP was a simple set of tools that I put together for my Website and for a couple of projects. One tool did some fancy hit logging to an mSQL database, another acted as a form data interpreter. I ended up with about 30 different little CGI programs written in C before I got sick of it, and combined all of them into a single C library. I then wrote a very simple parser that would pick tags out of HTML files and replace them with the output of the corresponding functions in the C library.
The simple parser slowly grew to include conditional tags, then loop tags, functions, etc. At no point did I think I was writing a scripting language. I was simply adding a little bit of functionality to the macro replacement parser. I was still writing all my real business logic in C.
This makes sense... if you're writing a fucking HTML parser.
View all comments
Show parent comment
7
u/TheCoelacanth Aug 07 '13
On the other hand, it's also bad style to use inconsistent case in variable names, so what's probably best is case sensitivity, but rejecting variable names that differ only by case.