0

PHP functions are not case sensitive , but if I want them to be is there any way to do it ??

function FIRe()
{
   return "FIR Emergency";
}

function FIRE()
{
    return "FIRE OUT THERE";
}
FIRe();

Note: Again saying, I know they are case-insensitive, is there any way to make them case sensitive?

frunkad
  • 2,433
  • 1
  • 23
  • 35
  • 2
    No, luckily there isn't. Your example makes a pretty good proof against case-sensitive identifiers. – mario Feb 04 '15 at 18:23
  • @Jay Blanchard I know they are case insensitive , my question is "Is there a way to make them case sensitive?" – frunkad Feb 04 '15 at 18:24
  • @Rizier123 some case like the one in code snippet above – frunkad Feb 04 '15 at 18:24
  • The link and the information contained there answer your question @DarshanJain – Jay Blanchard Feb 04 '15 at 18:24
  • 1
    @DarshanJain why would you want to do such a horrible thing? Why would you want several functions that do different things but share the same name apart from the case? Are you some kind of monster? – serakfalcon Feb 04 '15 at 18:25
  • Like using any function like `create_function()` or such – frunkad Feb 04 '15 at 18:26
  • 1
    You could store the function name inside of a case sensitive variable and `$FIRe()`/`$FIRE()`. You could also likely namespace them or put them in separate classes. – Jonathan Kuhn Feb 04 '15 at 18:31
  • @Jonathan Kuhn can you post it as an answer with some examples plz ? – frunkad Feb 04 '15 at 18:32

0 Answers0