|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #37613 tempnam suffix support and dir behavior change
Submitted: 2006-05-27 12:20 UTC Modified: 2021-09-27 12:23 UTC
Avg. Score:4.7 ± 0.6
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:2 (28.6%)
From: wardenik at gmail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.1.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: wardenik at gmail dot com
New email:
PHP Version: OS:


 [2006-05-27 12:20 UTC] wardenik at gmail dot com
It would be very useful if the tempnam function would allow to  support suffix on the created filename as well.  I'm creating for instance xml files with it, and they have to have .xml at the end.

Moreover, I think that the behavior that tempnam changes the prefix when unable to create the file in the supplied 'dir' is wrong. It should generate an error instead and not trash some other unwanted places.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 23:44 UTC]
-Package: Feature/Change Request +Package: Filesystem function related
 [2021-09-27 12:23 UTC]
> It should generate an error instead and not trash some other
> unwanted places.

As of PHP 7.1.0, a notice is emitted if the function falls back to
the system's temp directory[1].

[1] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 02:05:53 2022 UTC