Is anyone aware of some strange bugs when surpressing errors from file_get_contents()?
Here is my code:
Every once and a while, code using this variable would break. I traced it down to $group_data being empty - group_path() assembles a path, and it ran file_exists() to make sure the file it was returning really did exist. I removed the @ operator so I could run some buffer functions and capture the errors file_get_contents() might return... and suddenly the script no longer breaks.
I originally wrote the script on PHP 4.4.4, and it worked flawlessly. It got ported to 4.4.2, and then the hunt for this error began. I'm not sure if it's a problem with my webhost or PHP in general. I know how to avoid the issue, now, but I'm still curious.
Here is my code:
$group_data = @file_get_contents(group_path($group, $m));
Every once and a while, code using this variable would break. I traced it down to $group_data being empty - group_path() assembles a path, and it ran file_exists() to make sure the file it was returning really did exist. I removed the @ operator so I could run some buffer functions and capture the errors file_get_contents() might return... and suddenly the script no longer breaks.
I originally wrote the script on PHP 4.4.4, and it worked flawlessly. It got ported to 4.4.2, and then the hunt for this error began. I'm not sure if it's a problem with my webhost or PHP in general. I know how to avoid the issue, now, but I'm still curious.
