Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Binary-safe file write
Alias fputs
fwrite(resource $streamstring $data, ?int $length null): int|false
    public function write($contents)

    {

        
fwrite($this->handle$contents);



        
fflush($this->handle);
                return;

            }



            
fwrite($sink$body);

            
rewind($sink);

        };

    }
    {

        
$tmpfile tmpfile();



        
fwrite($tmpfile$content);



        return 
tap(new File($name$tmpfile), function ($file) use ($tmpfile) {

            
$file->sizeToReport fstat($tmpfile)['size'];
            call_user_func("image{$extension}"$image);



            
fwrite($tempob_get_clean());

        });

    }

}