php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41122 Incorrect resource type names for resources: fsockopen(), pfsockopen(), popen()
Submitted: 2007-04-17 14:19 UTC Modified: 2007-08-17 09:55 UTC
From: mahesh dot vemula at in dot ibm dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: RHEL 4
Private report: No CVE-ID: None
 [2007-04-17 14:19 UTC] mahesh dot vemula at in dot ibm dot com
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"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-17 09:55 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 01:01:35 2025 UTC