reference/var/functions/get-resource-type.xml
77887dc8e5ee9e840f0ed440431c70259fcc5661
...
...
@@ -13,7 +13,7 @@
13
13
&reftitle.description;
14
14
<methodsynopsis>
15
15
<type>string</type><methodname>get_resource_type</methodname>
16
-
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
16
+
<methodparam><type>resource</type><parameter>resource</parameter></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
This function gets the type of the given resource.
...
...
@@ -25,7 +25,7 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>handle</parameter></term>
28
+
<term><parameter>resource</parameter></term>
29
29
<listitem>
30
30
<para>
31
31
The evaluated resource handle.
...
...
@@ -39,40 +39,17 @@
39
39
<refsect1 role="returnvalues">
40
40
&reftitle.returnvalues;
41
41
<para>
42
-
If the given <parameter>handle</parameter> is a resource, this function
42
+
If the given <parameter>resource</parameter> is a resource, this function
43
43
will return a string representing its type. If the type is not identified
44
44
by this function, the return value will be the string
45
45
<literal>Unknown</literal>.
46
46
</para>
47
47
<para>
48
48
This function will return &null; and generate an error if
49
-
<parameter>handle</parameter> is not a <type>resource</type>.
49
+
<parameter>resource</parameter> is not a <type>resource</type>.
50
50
</para>
51
51
</refsect1>
52
52

53
-
<refsect1 role="changelog">
54
-
&reftitle.changelog;
55
-
<informaltable>
56
-
<tgroup cols="2">
57
-
<thead>
58
-
<row>
59
-
<entry>&Version;</entry>
60
-
<entry>&Description;</entry>
61
-
</row>
62
-
</thead>
63
-
<tbody>
64
-
<row>
65
-
<entry>PHP 5.3.0</entry>
66
-
<entry>
67
-
If <parameter>handle</parameter> is not a <type>resource</type> this
68
-
functions returns &null;. Formerly, &false; has been returned.
69
-
</entry>
70
-
</row>
71
-
</tbody>
72
-
</tgroup>
73
-
</informaltable>
74
-
</refsect1>
75
-

76
53
<refsect1 role="examples">
77
54
&reftitle.examples;
78
55
<para>
...
...
@@ -81,25 +58,35 @@
81
58
<programlisting role="php">
82
59
<![CDATA[
83
60
<?php
84
-
// prints: mysql link
85
-
$c = mysql_connect();
86
-
echo get_resource_type($c) . "\n";
87
-

88
-
// prints: stream
89
61
$fp = fopen("foo", "w");
90
62
echo get_resource_type($fp) . "\n";
91
63

92
-
// prints: domxml document
93
-
$doc = new_xmldoc("1.0");
94
-
echo get_resource_type($doc->doc) . "\n";
64
+
// As of PHP 8.0.0, the following does not work anymore. The curl_init function returns a CurlHandle object now.
65
+
$c = curl_init();
66
+
echo get_resource_type($c) . "\n";
95
67
?>
96
68
]]>
97
69
</programlisting>
70
+
&example.outputs.7;
71
+
<screen role="php">
72
+
<![CDATA[
73
+
stream
74
+
curl
75
+
]]>
76
+
</screen>
98
77
</example>
99
78
</para>
100
79
</refsect1>
101
-
</refentry>
102
80

81
+
<refsect1 role="seealso">
82
+
&reftitle.seealso;
83
+
<para>
84
+
<simplelist>
85
+
<member><function>get_resource_id</function></member>
86
+
</simplelist>
87
+
</para>
88
+
</refsect1>
89
+
</refentry>
103
90
<!-- Keep this comment at the end of the file
104
91
Local variables:
105
92
mode: sgml
106
93