reference/var/functions/print-r.xml
d816a0fad6c458d9515f697cc89e26ca9d8069f5
d816a0fad6c458d9515f697cc89e26ca9d8069f5
...
...
@@ -11,9 +11,9 @@
11
11
<refsect1 role="description">
12
12
&reftitle.description;
13
13
<methodsynopsis>
14
-
<type>mixed</type><methodname>print_r</methodname>
15
-
<methodparam><type>mixed</type><parameter>expression</parameter></methodparam>
16
-
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>false</initializer></methodparam>
14
+
<type class="union"><type>string</type><type>true</type></type><methodname>print_r</methodname>
15
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
16
+
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>&false;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
<function>print_r</function> displays information about a variable
...
...
@@ -22,14 +22,9 @@
22
22
<para>
23
23
<function>print_r</function>, <function>var_dump</function> and
24
24
<function>var_export</function> will
25
-
also show protected and private properties of objects with PHP 5.
25
+
also show protected and private properties of objects.
26
26
Static class members will not be shown.
27
27
</para>
28
-
<para>
29
-
Remember that <function>print_r</function> will move the array
30
-
pointer to the end. Use <function>reset</function> to bring
31
-
it back to beginning.
32
-
</para>
33
28
</refsect1>
34
29
35
30
<refsect1 role="parameters">
...
...
@@ -37,7 +32,7 @@
37
32
<para>
38
33
<variablelist>
39
34
<varlistentry>
40
-
<term><parameter>expression</parameter></term>
35
+
<term><parameter>value</parameter></term>
41
36
<listitem>
42
37
<para>
43
38
The expression to be printed.
...
...
@@ -61,7 +56,7 @@
61
56
<refsect1 role="returnvalues">
62
57
&reftitle.returnvalues;
63
58
<para>
64
-
If given a <type>string</type>, <type>integer</type> or <type>float</type>,
59
+
If given a <type>string</type>, <type>int</type> or <type>float</type>,
65
60
the value itself will be printed. If given an <type>array</type>, values
66
61
will be presented in a format that shows keys and elements. Similar
67
62
notation is used for <type>object</type>s.
...
...
@@ -72,11 +67,6 @@
72
67
</para>
73
68
</refsect1>
74
69
75
-
<refsect1 role="notes">
76
-
&reftitle.notes;
77
-
¬e.uses-ob;
78
-
</refsect1>
79
-
80
70
<refsect1 role="changelog">
81
71
&reftitle.changelog;
82
72
<para>
...
...
@@ -90,23 +80,9 @@
90
80
</thead>
91
81
<tbody>
92
82
<row>
93
-
<entry>4.3.0</entry>
94
-
<entry>
95
-
The <parameter>return</parameter> parameter was added. If you need to
96
-
capture the output of <function>print_r</function> with an older
97
-
version of PHP prior, use the
98
-
<link linkend="ref.outcontrol">output-control functions</link>.
99
-
</entry>
100
-
</row>
101
-
<row>
102
-
<entry>4.0.4</entry>
83
+
<entry>8.4.0</entry>
103
84
<entry>
104
-
Prior to PHP 4.0.4, <function>print_r</function> will continue forever
105
-
if given an <type>array</type> or <type>object</type> that
106
-
contains a direct or indirect reference to itself. An example
107
-
is <literal>print_r($GLOBALS)</literal> because
108
-
<literal>$GLOBALS</literal> is itself a global variable that
109
-
contains a reference to itself.
85
+
Return type changed from <type class="union"><type>string</type><type>bool</type></type> to <type class="union"><type>string</type><type>true</type></type>.
110
86
</entry>
111
87
</row>
112
88
</tbody>
...
...
@@ -125,7 +101,7 @@
125
101
<pre>
126
102
<?php
127
103
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
128
-
print_r ($a);
104
+
print_r($a);
129
105
?>
130
106
</pre>
131
107
]]>
...
...
@@ -158,6 +134,8 @@ Array
158
134
<?php
159
135
$b = array ('m' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z'));
160
136
$results = print_r($b, true); // $results now contains output from print_r
137
+
138
+
print_r($results);
161
139
?>
162
140
]]>
163
141
</programlisting>
...
...
@@ -165,6 +143,11 @@ $results = print_r($b, true); // $results now contains output from print_r
165
143
</para>
166
144
</refsect1>
167
145
146
+
<refsect1 role="notes">
147
+
&reftitle.notes;
148
+
¬e.uses-ob-php70;
149
+
</refsect1>
150
+
168
151
<refsect1 role="seealso">
169
152
&reftitle.seealso;
170
153
<para>
...
...
@@ -177,7 +160,6 @@ $results = print_r($b, true); // $results now contains output from print_r
177
160
</refsect1>
178
161
179
162
</refentry>
180
-
181
163
<!-- Keep this comment at the end of the file
182
164
Local variables:
183
165
mode: sgml
184
166