Class names in PHP are case insensitive. The following two are equivalent:
class Something extends BaseClass {}
and
class someThing extends baseClass {}
However…
If you are using an autoloader that searches for a class file when the class is required, the autoloader will match the file based on the filesystem’s case-sensitivity. This caught me out because I develop on a Mac which is case-aware but not case sensitive. When I deployed some code to a Linux server I discovered I had a class which … extends view
rather than … extends View
. The autoloader found the file (View.php
) on my dev machine but the remote server was looking for view.php
, couldn’t find it and erorred out.