Make file_put_contents silent when writing to a file. Capturing the return value should be enough.