I had a second look at this stuff and in contrary to my initial statement this is not fopen related but related to the git check style for text files. Git is converting the line endings on windows during checkout, which results in a different file size.

We have two options now
1.) agree on using filesize() to be a valid test
2.) use an image instead of a text file where the filesize is unchanged on various platforms