How do I force PHP to be case sensitive?
Posted: Mon Jun 14, 2010 5:44 am
Hello,
Is there a way to force PHP to be case sensitive with class names.
The issue I am having is:
When typing a class name there may be the odd time where I may misspell it, so instead of typing -
$my_new_class = new My_New_Class();
I may type -
$my_new_class = new My_New_class();
This causes some major headaches with Apache... it causes my version of apache to spit out an error (invalid opcode: 0000 [#13] SMP) and a huge stack trace (I'm running Apache from Ubuntu 10.04 within VMWare, on a Mac as my testing environment).
As the website I am working on is a company project many developers work on it in many different environments (some Windows, some Linux, etc), and I cannot always rely on perfectly written code by everyone. I would rather PHP could catch the error in my class declaration due to not apply the correct case sensitivity and show a fatal or warning message - this would help me identify the problem and file the class declaration. Even if case sensitivity did not break apache I would rather have this setting enabled to clean up my code and make it more consistent.
Is there anyway to do this? Maybe by setting in the php.ini file to make PHP case sensitive with filenames.
Any ideas would be greatly appreciated.
Thanks
Lee
Is there a way to force PHP to be case sensitive with class names.
The issue I am having is:
When typing a class name there may be the odd time where I may misspell it, so instead of typing -
$my_new_class = new My_New_Class();
I may type -
$my_new_class = new My_New_class();
This causes some major headaches with Apache... it causes my version of apache to spit out an error (invalid opcode: 0000 [#13] SMP) and a huge stack trace (I'm running Apache from Ubuntu 10.04 within VMWare, on a Mac as my testing environment).
As the website I am working on is a company project many developers work on it in many different environments (some Windows, some Linux, etc), and I cannot always rely on perfectly written code by everyone. I would rather PHP could catch the error in my class declaration due to not apply the correct case sensitivity and show a fatal or warning message - this would help me identify the problem and file the class declaration. Even if case sensitivity did not break apache I would rather have this setting enabled to clean up my code and make it more consistent.
Is there anyway to do this? Maybe by setting in the php.ini file to make PHP case sensitive with filenames.
Any ideas would be greatly appreciated.
Thanks
Lee