#32107 [Opn->Fbk]: fclose (STDIN|STDOUT|STDERR) not working
| From: | tony2001@php.net | Date: | Fri, 25 Feb 2005 12:03:47 +0000 |
| Subject: | #32107 [Opn->Fbk]: fclose (STDIN|STDOUT|STDERR) not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74556@lists.php.net to get a copy of this message | ||
ID: 32107
Updated by: tony2001@php.net
Reported By: php at the-eend dot org
-Status: Open
+Status: Feedback
Bug Type: CGI related
Operating System: Redhat ES3
PHP Version: 4.3.10
New Comment:
Why do you think they are not closed?
<?php
var_dump(STDIN);
fclose (STDIN);
var_dump(fread(STDIN, 10));
?>
Or use var_dump() in your example:
<?php
var_dump(STDIN);
fclose (STDIN);
var_dump(STDIN);
?>
Previous Comments:
------------------------------------------------------------------------
[2005-02-25 12:54:31] php at the-eend dot org
Description:
------------
This is the same bug as reported and fixed for PHP5 last year:
http://bugs.php.net/bug.php?id=27865 , but is
still present in 4.3.10.
Upgrading to PHP 5 is not an option at this point. Any chance this can
be back-ported?
With CLI scripts, fclosing STDIN, STDOUT and STDERR have no effect,
leaving the sockets open, and the terminal which ran the script
hanging.
Reproduce code:
---------------
echo STDIN . '|' . STDOUT . '|' . STDERR . "\n";
fclose (STDIN);
fclose (STDOUT);
fclose (STDERR);
echo STDIN . '|' . STDOUT . '|' . STDERR . "\n";
Expected result:
----------------
The STDIN, STDOUT and STDERR streams should be closed:
Resource id #1|Resource id #2|Resource id #3
||
(perhaps, though this would mean the value of a 'constant' was being
changed...)
Actual result:
--------------
The streams are not closed, and remain pointing to the same resources:
Resource id #1|Resource id #2|Resource id #3
Resource id #1|Resource id #2|Resource id #3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32107&edit=1