Skip to content

Commit f8aa094

Browse files
committed
Update getiterator.xml Amend the example code
php/doc-en@da11d3f
1 parent 3564678 commit f8aa094

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

reference/spl/arrayobject/getiterator.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: da11d3f56626c3d87a4933227180909676b27109 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="arrayobject.getiterator" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -39,19 +39,23 @@
3939
<programlisting role="php">
4040
<![CDATA[
4141
<?php
42-
$array = array('1' => 'one',
43-
'2' => 'two',
44-
'3' => 'three');
42+
43+
$array = [
44+
'1' => 'one',
45+
'2' => 'two',
46+
'3' => 'three',
47+
];
4548
4649
$arrayobject = new ArrayObject($array);
4750
4851
$iterator = $arrayobject->getIterator();
4952
50-
while($iterator->valid()) {
53+
while ($iterator->valid()) {
5154
echo $iterator->key() . ' => ' . $iterator->current() . "\n";
5255
5356
$iterator->next();
5457
}
58+
5559
?>
5660
]]>
5761
</programlisting>

0 commit comments

Comments
 (0)