| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2000-07-11 11:30 UTC] stas at cvs dot php dot net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
$filename = tempnam("/tmp", "blah"); <do all kinds of stuff that takes more than 0 seconds> $fd = fopen($filename, "w+"); This could result in another proces on the system creating a temp-file with the same name in the meantime, which then will be overwritten by PHP. See man mkstemp on any UNIX for more details and the solution to the same problem (returning a file descriptor of a newly opened temp-file instead of a filename). It could be that PHP found a way to magically circumvent the problem, but that is not documented anywhere I looked.