Bug #72317 [Fbk->Opn]: tempnam fails with prefix "php"
| From: | flip101 at gmail dot com | Date: | Fri, 03 Jun 2016 13:20:45 +0000 |
| Subject: | Bug #72317 [Fbk->Opn]: tempnam fails with prefix "php" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201426@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72317&edit=1
ID: 72317
User updated by: flip101 at gmail dot com
Reported by: flip101 at gmail dot com
Summary: tempnam fails with prefix "php"
-Status: Feedback
+Status: Open
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows 10 64 bits
-PHP Version: 5.6.22
+PHP Version: 5.6.20
Block user comment: N
Private report: N
New Comment:
I double check error reporting it's on E_ALL both in my php.ini (and i double check that i was
viewing the right php.ini by checking which one was loaded) and also i put error_reporting(E_ALL);
at the top (new script at the bottom of this comment). I don't see any warnings or notices,
exact output at bottom of comment. My exact php version is this one: php-5.6.20-Win32-VC11-x64.zip
==== Script
<?php
error_reporting(E_ALL);
var_dump(
file_exists(sys_get_temp_dir()),
is_writable(sys_get_temp_dir()),
sys_get_temp_dir(),
tempnam(sys_get_temp_dir(), 'php'),
tempnam(sys_get_temp_dir(), 'aaa')
);
==== End script
==== Console
C:\dev>php test.php
bool(true)
bool(true)
string(34) "C:\Users\plagas\AppData\Local\Temp"
bool(false)
string(46) "C:\Users\plagas\AppData\Local\Temp\aaaE26E.tmp"
==== End Console
Previous Comments:
------------------------------------------------------------------------
[2016-06-03 12:21:38] cmb@php.net
I can't reproduce this issue, neither on Windows 10 x64 with
PHP 5.6.22 VC11 x64 Non Thread Safe (2016-May-26 18:22:21), nor on
3v4l.org, see <https://3v4l.org/Wig5o>.
Please make sure that you have error_reporting=-E_ALL, and double-
check that there are no warnings or notices reported.
------------------------------------------------------------------------
[2016-06-02 15:35:19] flip101 at gmail dot com
Description:
------------
Not sure if the "php" prefix is reserved, but if it is, it's not documented at https://secure.php.net/manual/en/function.tempnam.php
Note: that i made up the expected results (on line 4), not sure how the random filename algorithm
works.
Test script:
---------------
var_dump(
file_exists(sys_get_temp_dir()),
is_writable(sys_get_temp_dir()),
sys_get_temp_dir(),
tempnam(sys_get_temp_dir(), 'php'),
tempnam(sys_get_temp_dir(), 'aaa')
);
Expected result:
----------------
bool(true)
bool(true)
string(34) "C:\Users\flip101\AppData\Local\Temp"
string(45) "C:\Users\flip101\AppData\Local\Temp\php2EC.tmp"
string(45) "C:\Users\flip101\AppData\Local\Temp\aaaF2A.tmp"
Actual result:
--------------
bool(true)
bool(true)
string(34) "C:\Users\flip101\AppData\Local\Temp"
bool(false)
string(45) "C:\Users\flip101\AppData\Local\Temp\aaaF2A.tmp"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72317&edit=1