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,14 +39,14 @@
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
-
This function will return &false; and generate an error if
49
-
<parameter>handle</parameter> is not a <type>resource</type>.
48
+
This function will return &null; and generate an error if
49
+
<parameter>resource</parameter> is not a <type>resource</type>.
50
50
</para>
51
51
</refsect1>
52
52

...
...
@@ -58,25 +58,35 @@
58
58
<programlisting role="php">
59
59
<![CDATA[
60
60
<?php
61
-
// prints: mysql link
62
-
$c = mysql_connect();
63
-
echo get_resource_type($c) . "\n";
64
-

65
-
// prints: stream
66
61
$fp = fopen("foo", "w");
67
62
echo get_resource_type($fp) . "\n";
68
63

69
-
// prints: domxml document
70
-
$doc = new_xmldoc("1.0");
71
-
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";
72
67
?>
73
68
]]>
74
69
</programlisting>
70
+
&example.outputs.7;
71
+
<screen role="php">
72
+
<![CDATA[
73
+
stream
74
+
curl
75
+
]]>
76
+
</screen>
75
77
</example>
76
78
</para>
77
79
</refsect1>
78
-
</refentry>
79
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>
80
90
<!-- Keep this comment at the end of the file
81
91
Local variables:
82
92
mode: sgml
83
93