#32107 [Opn-Fbk]: fclose (STDIN|STDOUT|STDERR) not working

2005-02-25 Thread tony2001
 ID:   32107
 Updated by:   [EMAIL PROTECTED]
 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=32107edit=1


#32107 [Opn-Fbk]: fclose (STDIN|STDOUT|STDERR) not working

2005-02-25 Thread tony2001
 ID:   32107
 Updated by:   [EMAIL PROTECTED]
 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:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.




Previous Comments:


[2005-02-25 13:33:10] php at the-eend dot org

True enough, the resource goes from being a stream to an Unknown.
Unfortunately, my terminal still hangs until the script is complete
when I try to log out of the server. If the stream is truly closed (not
saying I don't believe you ;)), I guess it must be something else. :(

I sense an incoming bogus... ;)



[2005-02-25 13:03:46] [EMAIL PROTECTED]

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);
?



[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=32107edit=1