ForgotPasswordAgain quoted the applicable documentation. Based on this quote, I would expect all three cases to create the temporary file. I agree that only the third case should. The quoted specification should be changed to reflect this.
The documentation says that using "undef" (not "an undefined value") creates the temporary file, but the first two cases don't use undef. As such, according to the documentation, only the third case should create the temporary file.