There are many URL routing classes available, from frameworks (Laravel Routing) to stand alone classes such as FastRoute. Each routing class does its job slightly differently, some make use of regex, some do basic string comparisons and so on. I am in the process of designing my own routing class customized to the needs of my application and came across a question that I have not yet found a satisfactory answer to.
Should URL routing be case sensitive or not?
Obviously either way can be done in PHP, but my question is about which is the best choice to go for. PHP itself is very confusing when it comes to this. $variable_names
are case sensitive while functionNames()
are not. So finding standardization in the language itself is pointless. I am after a concise answer as to which method is the one I should stick to, and why.