From:             mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  Incorrect resource type names for resources: fsockopen(), 
pfsockopen(), popen()

Description:
------------
fsockopen, pfsockopen, popen, and opendir functions use streams layer
Implementation. So, the resources created by these functions are of stream
type. But PHP5 documentation shows the resource type names different in
http://in2.php.net/manual/en/resource.php

Updation in this regard at http://in2.php.net/manual/en/resource.php is
required. The “Resource type name” column should be modified to “stream”
for functions: fsockopen(), pfsockopen(), popen() and opendir()

Below code confirms that the resources created by fopen, fsockopen,
pfsockopen, popen, and opendir functions are of stream type.

Environment:
Operating System: RHEL 4
Linux Kernel : Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net)
PHP Configure Setup: ./configure


Reproduce code:
---------------
<?php
$file_handle  = fopen( __FILE__, "r" );
var_dump( get_resource_type($file_handle) );
fclose( $file_handle );

$dir_handle  = opendir( "." );
var_dump( get_resource_type($dir_handle) );
closedir( $dir_handle );

$pipe_handle = popen( "/bin/ls", "r" );
var_dump( get_resource_type($pipe_handle) );
pclose( $pipe_handle );

$socket_handle = fsockopen( "tcp://127.0.0.1", 23 );
var_dump( get_resource_type($socket_handle) );
fclose( $socket_handle );
?>


Expected result:
----------------
string(6) "stream"
string(6) "stream"
string(6) "stream"
string(6) "stream"


Actual result:
--------------
string(6) "stream"
string(6) "stream"
string(6) "stream"
string(6) "stream"


-- 
Edit bug report at http://bugs.php.net/?id=41122&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41122&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41122&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41122&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41122&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41122&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41122&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41122&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41122&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41122&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41122&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41122&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41122&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41122&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41122&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41122&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41122&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41122&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41122&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41122&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41122&r=mysqlcfg

Reply via email to