Assuming you mean the file's creation date, this is a known behaviour of the Windows file system. If you delete, move, or rename a file and then recreate it (within some small period of time) it will magically inherit the previous creation timestamp.
While this is surprising, it is usually the sensible thing to do, e.g., this sequence of events is typical for a text editor when you save your changes, and clearly the creation date of a file shouldn't change just because you've modified it.
Possible workarounds;
Create the new file with a unique name, then move it over top of the original file. It must be a genuine atomic move (i.e., a call to
MoveFileEx
withMOVEFILE_REPLACE_EXISTING
, or equivalent) rather than deleting the old file and renaming the new one. I don't know whether or not you can do this with PHP.Explicitly set the creation date yourself (
SetFileInformationByHandle
). Again, no idea whether PHP allows you to do this.Wait long enough between deleting the file and recreating it. I don't know how long "long enough" is and it might vary between different Windows versions or even within a Windows version for unpredictable reasons, so unless you can find some detailed documentation doing it this way probably isn't reliable.
Don't bother; make sure you use the modification date rather than the creation date when applying whatever logic it is that cares about the timestamps.