The situation described below caused a fatal error in PHP in about 50% of the browsers whereas in other browsers the code ran normally. No browser or any client info sniffing was used. As far as I know this should not be possible (PHP running differently depending on client browser). The issue has been resolved but I still want to understand exactly how this could happen.
So index.php includes 2 files:
include('a.php');
include('b.php');
a.php:
the_function();
b.php:
function the_function(){
//code
}
The fatal error in 50% of the browsers was that the_function was not defined in a.php, so a.php was executed immediately upon include. Whereas in other browsers it seemed to first include all php files and only then start executing.
If I remember correctly they were Mac Safari, Mac Chrome, and IE but I don't even know whether this behavior is shared among the same browsers on different machines.
the issue of course was resolved by switching the order of includes. But I still want to understand why this happened.