denisyukphp / tmpfile
Alternative to tmpfile() function.
3.0.12
2025-12-05 11:34 UTC
Requires
- php: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.91
- php-parallel-lint/php-console-highlighter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.4
- phpunit/phpunit: ^9.6
- psalm/plugin-phpunit: ^0.18
- rector/rector: ^2.2
- vimeo/psalm: ^5.26
Suggests
- denisyukphp/tmpfile-manager: Allows more advanced creating and removing temp files.
README
Alternative to tmpfile() function.
Installation
You can install the latest version via Composer:
composer require denisyukphp/tmpfile
This package requires PHP 8.0 or later.
Quick usage
A temp file will be removed after PHP finished:
<?php use TmpFile\TmpFile; $tmpFile = new TmpFile(); file_put_contents($tmpFile, 'Meow!'); rename($tmpFile, '/path/to/meow.txt');
Read more about temp file on Habr.