Please note that this function might throw a notice in PHP 7.1.0 and above. This was a bugfix: https://bugs.php.net/bug.php?id=69489
You can place an address operator (@) to sillence the notice:
<?php
if ($tmp = @tempnam() !== false) {
// ...
}
?>
Or you could try to set the "upload_tmp_dir" setting in your php.ini to the temporary folder path of your system. Not sure, if the last one prevents the notices.