sys_get_temp_dir

Supported Versions: PHP 5 >= 5.2.1, PHP 7, PHP 8
Returns directory path used for temporary files
sys_get_temp_dir(): string
                    $parsedBody = [];

                    foreach (
$document->getParts() as $part) {

                        if (
$part->isFile()) {

                            
$tmpPath tempnam(sys_get_temp_dir(), 'bref_upload_');

                            if (
$tmpPath === false) {

                                throw new 
RuntimeException('Unable to create a temporary directory');

                            }