Skip to content

Commit ca2e1a4

Browse files
Modernize array syntax, use var_dump over print_r for example php#1
1 parent d1f71bd commit ca2e1a4

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

reference/array/functions/array-unshift.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,29 @@
8484
<programlisting role="php">
8585
<![CDATA[
8686
<?php
87-
$queue = array("orange", "banana");
87+
$queue = [
88+
"orange",
89+
"banana"
90+
];
91+
8892
array_unshift($queue, "apple", "raspberry");
89-
print_r($queue);
93+
var_dump($queue);
9094
?>
9195
]]>
9296
</programlisting>
9397
&example.outputs;
9498
<screen role="php">
9599
<![CDATA[
96-
Array
97-
(
98-
[0] => apple
99-
[1] => raspberry
100-
[2] => orange
101-
[3] => banana
102-
)
100+
array(4) {
101+
[0] =>
102+
string(5) "apple"
103+
[1] =>
104+
string(9) "raspberry"
105+
[2] =>
106+
string(6) "orange"
107+
[3] =>
108+
string(6) "banana"
109+
}
103110
]]>
104111
</screen>
105112
</example>

0 commit comments

Comments
 (0)