The problem: code seems to work only on its original directory (on my virtual-machine).

Tools involved: git, GitHub, Travis.

Time to figure out: I feel dumb for not asking for help on freenode or something and embarrassed of telling how many hours it took me to figure out!

To whom it may happen: anyone developing software on Mac, relying on autoloading or not (if you use something like file_exists() to know if your file really exists before including it it might get hard to debug).

Ocassion: I'm working alone on a personal project written in PHP (but the problem might have occurred in many other languages). I'm the sole developer of it. I run its code on a Ubuntu virtual-machine and develop on my Mac OS X.

Setup: The code is hosted on my home directory on the Mac OS X's filesystem (HFS+, case-insensitive) and accessed on the Ubuntu side with NFS (which I don't recommend and will change for an alternative soon).

How happened: I'm setting up my CI with Travis and after the commit it failed to pass the tests and the error messages didn't help. It tried to include_once several files which are to be loaded with autoloading (Zend_Loader_Autoloader). My impression was that it was using another autoloading system (of PHPUnit, which doesn't exists btw) or something. It happened on Travis first but as soon as I tried to replicate the error by cloning the repo on my Linux home directory and setting up the configurations necessary for it prior to running PHPUnit it also happened there.

Steps I took to reproduce the error:
1) from the Linux virtual-machine I tried to copy the contents to another directory also on Mac over NFS. It failed silently. Apparently everything was fine, but the NFS corrupted it. It is not the first time NFS let me down and I'm moving away from it. I noticed it failed when I tried to run PHPUnit and saw other errors and checked some files and they were corrupted.
2) copied the directory to my Linux's home directory and tried to run the tests. It also failed.
3) searched the web for anything weird about autoloading which affected PHPUnit with no success.
4) cloned the repo directly from GitHub and from my Mac's local copy and tried to run the tests. Also, no success.
5) Finally: moved the directory from the Mac over NFS to Ubuntu (and the tests failed as expected) and then back to Mac (the tests started working again).

Diagnostic: remembered Mac is case-insensitive but the commonly found ext3, ext4, ReiserFS, and others partitions used on most of Linux distros are set as case-sensitive. Zend_Loader tried to find the files, "but if no $dirs were specified, it will attempt to load it from PHP's include_path" (text in quotes from the Zend_Loader class).

What happened is the following: retrieving the code from NFS (Mac, case-insensitive) the file would be found even if it was being called in the wrong case (file.php instead of File.php for example). But when the file was being searched on Linux, it would not be found and Zend_Loader gracefully would try to include it from PHP's include_path.

1) What happened with me? I always ask when in such situation, this time I just forgot.
2) Don't forget Macs comes with a case-insensitive partition ever again.
3) NFS is evil. Stop using it immediately.

My mistake: a single letter in the wrong case (I've renamed the directory some time ago from ML to Ml).