I've already submitted a bug report to PHP.net since I've put together a standalone script which replicates the issue I'm having no problem, but only in PHP 5.2.11. The problem for me is this totally breaks any scripts that need to use file_get_contents() to fetch remote files several times in the same job. The files PHP is fetching, it's adding header information automatically to a few of those files - when I did my tests 80 images were fetched, but 12 were amended with header info, as follows:
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_NYDTHH
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_nyNQFp
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_pfiKkt
-rw------- 1 nobody nobody 1778247 Sep 21 09:15 test_img_PfqLqg
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_PgNxEV
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_PN1hWM
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_PUeJ64
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_roULhb
-rw------- 1 nobody nobody 1778247 Sep 21 09:15 test_img_rUL5Gr
-rw------- 1 nobody nobody 1778247 Sep 21 09:15 test_img_rWDMZO
-rw------- 1 nobody nobody 1777966 Sep 21 09:15 test_img_t7eCOU
Notice the files sizes differ. The files that are slightly bigger contain header info. The next stage in the process is to use imagecreatefrompng() as the files are all PNG files, thus the size, but this is failing with the reason "file is not a valid PNG".
If anyone has any scripts that utilise this function in this way, I would strongly recommend not installing PHP 5.2.11 till the problem has been fixed. This does not occur with PHP 5.2.10.