#48641 [Opn->Csd]: tmpfile() uses old parameter parsing
| From: | felipe@php.net | Date: | Mon, 22 Jun 2009 11:38:42 +0000 |
| Subject: | #48641 [Opn->Csd]: tmpfile() uses old parameter parsing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138626@lists.php.net to get a copy of this message | ||
ID: 48641
Updated by: felipe@php.net
Reported By: crrodriguez at opensuse dot org
-Status: Open
+Status: Closed
Bug Type: Filesystem function related
Operating System: Irrelevant
PHP Version: 5.3CVS-2009-06-22 (CVS)
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2009-06-22 11:16:23] crrodriguez at opensuse dot org
Description:
------------
tmpfile() still uses the old parameter parsing stuff..so an incomplete
warning is issued when the function is called with parameters.
fix:
cvs diff: Diffing ext/standard
Index: ext/standard/file.c
===================================================================
RCS file: /repository/php-src/ext/standard/file.c,v
retrieving revision 1.409.2.6.2.28.2.35
diff -u -p -r1.409.2.6.2.28.2.35 file.c
--- ext/standard/file.c 24 May 2009 16:01:47 -0000
1.409.2.6.2.28.2.35
+++ 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
NULL
Actual result:
--------------
Warning: Wrong parameter count for tmpfile() in Command line code on
line 1
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48641&edit=1