views:

678

answers:

3

I see .class and .inc included in file names a lot of the time. My current understanding is that this is just a best practice to make the purpose/contents of the file clear.

Is there any instance in PHP where a .class or .inc file name has a special purpose and truly means something?

+3  A: 

Not really

Depending on how you have your .htaccess file set up, it can determine which classes are visible to the world. I believe best practice still says to end every file with .php if you can.

Joe Philllips
Seconded. If you have to use class and inc, add a .php: `.class.php` `.inc.php`
Pekka
A: 

In my opinion the best practice is to use a Framework and use the same naming conventions they uses in their sample projects. I don't think there is a Standard for it since it doesn't make a difference.

Most people name their classes as *.class.php and their static files as *.inc.php.

mnml
+1  A: 

It is suggested by PHP best practice coding standards to name classes with class keyword somewhere in the class file name. However, the final decision is yours whether you want to stick with that or not. It has nothing to do with code execution.

Sarfraz