|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48641 tmpfile() uses old parameter parsing
Submitted: 2009-06-22 11:16 UTC Modified: 2009-06-22 11:38 UTC
From: crrodriguez at opensuse dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5.3CVS-2009-06-22 (CVS) OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: crrodriguez at opensuse dot org
New email:
PHP Version: OS:


 [2009-06-22 11:16 UTC] crrodriguez at opensuse dot org
tmpfile() still uses the old parameter parsing an incomplete warning is issued when the function is called with parameters.


cvs diff: Diffing ext/standard
Index: ext/standard/file.c
RCS file: /repository/php-src/ext/standard/file.c,v
retrieving revision 1.409.
diff -u -p -r1.409. file.c
--- ext/standard/file.c 24 May 2009 16:01:47 -0000      1.409.
+++ ext/standard/file.c 22 Jun 2009 11:14:39 -0000
@@ -869,8 +869,8 @@ PHP_NAMED_FUNCTION(php_if_tmpfile)
        php_stream *stream;

-       if (ZEND_NUM_ARGS() != 0) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters_none() == FAILURE) {
+               return;

        stream = php_stream_fopen_tmpfile();

Reproduce code:
php -r 'var_dump(tmpfile(0));'

Expected result:
Warning: tmpfile() expects exactly 0 parameters, 1 given in Command line code on line 1

Actual result:
Warning: Wrong parameter count for tmpfile() in Command line code on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-22 11:38 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 00:05:48 2023 UTC