#22177 [Csd->Bgs]: Warning: fopen() expects parameter 1 to be string
| From: | wez@php.net | Date: | Wed, 12 Feb 2003 00:15:23 +0000 |
| Subject: | #22177 [Csd->Bgs]: Warning: fopen() expects parameter 1 to be string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32845@lists.php.net to get a copy of this message | ||
ID: 22177
Updated by: wez@php.net
Reported By: laudanp@yahoo.com
-Status: Closed
+Status: Bogus
Bug Type: Filesystem function related
Operating System: RedHat
PHP Version: 4.3.0
New Comment:
"Warning: fopen() expects parameter 1 to be string"
Now read the manual for fopen -> parameter 1 needs to be a string.
You are passing a resource.
The fact that this "worked" for you in 4.2.3 indicates a bug in 4.2.3
that has been fixed in 4.3.
Your supposed temporary file name would be a string "Resource id #4",
which isn't a very good temporary file name.
You describe the expected behaviour of PHP, your script is broken,
therefore this is a user error, and thus a bogus report.
Now, please leave us in peace to fix real bugs.
Previous Comments:
------------------------------------------------------------------------
[2003-02-11 18:08:39] laudanp@yahoo.com
Assure you no user error.
------------------------------------------------------------------------
[2003-02-11 18:01:44] wez@php.net
User error.
Please leave this as bogus.
------------------------------------------------------------------------
[2003-02-11 16:05:05] laudanp@yahoo.com
I don't consider this bogus and your thoughts are your own. I wouldn't
be the type to just submit a bug report that I didn't think was
founded. The code worked under 4.2.3 and if you care to check I can
send the whole package to you to disprove your "thoughts".
Upgrading to php 4.3 has broken the subroutine. Instead of "thinking"
that it doesn't work I would suspect more from php developers for a
more quantitative analysis of the situation.
Ergo I prefer to close this bug report myself because I'm apparently
not getting any constructive feedback here, instead of having it
labeled as "bogus".
Once again, the code, unchanged prior 4.3 worked. The same exact code
that worked no longer does. Absolutely nothing has been changed.
Anyhow, thanks for replying at least. It is much better to know where
one stands rather than not getting any reply whatsoever.
------------------------------------------------------------------------
[2003-02-11 15:59:23] nicos@php.net
As Jani said, tmpfile returns a resource, no need to try to fopen it.
He said also that nothing was changed in 4.3.0 about it, which is
right. Your code is bogus and I don't think it ever worked.
See: http://www.php.net/manual/en/function.tmpfile.php
resource tmpfile ( void)
Creates a temporary file with an unique name in write mode, returning a
file handle similar to the one returned by fopen(). The file is
automatically removed when closed (using fclose()), or when the script
ends.
You should use:
$temp = tmpfile();
fwrite($temp, "writing to tempfile");
fclose($temp); // this removes the file
Not a bug->Bogus again.
------------------------------------------------------------------------
[2003-02-11 15:52:09] laudanp@yahoo.com
Per me previous comment addition, the code was not changed whatsoever.
I'm "re-opening" this bug report in the hopes it will gather a
response.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22177
--
Edit this bug report at http://bugs.php.net/?id=22177&edit=1