How do I force PHP to be case sensitive?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leewilson86
Forum Newbie
Posts: 1
Joined: Mon Jun 14, 2010 5:34 am

How do I force PHP to be case sensitive?

Post by leewilson86 »

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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: How do I force PHP to be case sensitive?

Post by Weirdan »

This is most likely a kernel bug (nothing to do with php). Post the backtrace you're getting.
Post Reply