Skip to content

Commit 7c36851

Browse files
committed
ArrayObject::__construct: clarify subtyping of iteratorClass parameter
php/doc-en@65c5581
1 parent 2e9161e commit 7c36851

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

reference/spl/arrayobject/construct.xml

Lines changed: 19 additions & 12 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: 65c558143647fe63b8073180ba314067d5ea4b62 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="arrayobject.construct" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -50,7 +50,7 @@
5050
<classname>ArrayObject</classname> オブジェクトの反復処理に使用するクラスを指定します。
5151
ここで指定するクラスは、
5252
<interfacename>ArrayIterator</interfacename>
53-
を実装していなければなりません
53+
の部分型でなければなりません
5454
</para>
5555
</listitem>
5656
</varlistentry>
@@ -66,26 +66,33 @@
6666
<programlisting role="php">
6767
<![CDATA[
6868
<?php
69-
$array = array('1' => 'one',
70-
'2' => 'two',
71-
'3' => 'three');
69+
70+
$array = [
71+
'1' => 'one',
72+
'2' => 'two',
73+
'3' => 'three'
74+
];
7275
7376
$arrayobject = new ArrayObject($array);
7477
7578
var_dump($arrayobject);
79+
7680
?>
7781
]]>
7882
</programlisting>
7983
&example.outputs;
8084
<screen>
8185
<![CDATA[
82-
object(ArrayObject)#1 (3) {
83-
[1]=>
84-
string(3) "one"
85-
[2]=>
86-
string(3) "two"
87-
[3]=>
88-
string(5) "three"
86+
object(ArrayObject)#1 (1) {
87+
["storage":"ArrayObject":private]=>
88+
array(3) {
89+
[1]=>
90+
string(3) "one"
91+
[2]=>
92+
string(3) "two"
93+
[3]=>
94+
string(5) "three"
95+
}
8996
}
9097
]]>
9198
</screen>

0 commit comments

Comments
 (0)