reference/com/examples.xml
28f122648d4f4b0c23d36dbfb5950da50c501b18
...
...
@@ -7,7 +7,7 @@
7
7
<section xml:id="com.examples.foreach">
8
8
<title>For Each</title>
9
9
<para>
10
-
Starting with PHP 5, you may use PHP's own
10
+
You may use PHP's own
11
11
&foreach; statement to iterate
12
12
over the contents of a standard COM/OLE IEnumVariant. In layman's terms,
13
13
this means that you can use foreach in places where you would have used
...
...
@@ -30,22 +30,7 @@ Next
30
30
</para>
31
31
<para>
32
32
<example>
33
-
<title>while() ... Next() in PHP 4</title>
34
-
<programlisting role="php">
35
-
<![CDATA[
36
-
<?php
37
-
$domainObject = new COM("WinNT://Domain");
38
-
while ($obj = $domainObject->Next()) {
39
-
echo $obj->Name . "<br />";
40
-
}
41
-
?>
42
-
]]>
43
-
</programlisting>
44
-
</example>
45
-
</para>
46
-
<para>
47
-
<example>
48
-
<title>foreach in PHP 5</title>
33
+
<title>foreach in PHP</title>
49
34
<programlisting role="php">
50
35
<![CDATA[
51
36
<?php
...
...
@@ -64,14 +49,10 @@ foreach ($domainObject as $obj) {
64
49
<title>Arrays and Array-style COM properties</title>
65
50
<para>
66
51
Many COM objects expose their properties as arrays, or using array-style
67
-
access. In PHP 4, you may use PHP array syntax to read/write such a
68
-
property, but only a single dimension is allowed. If you want to read a
69
-
multi-dimensional property, you could instead make the property access
70
-
into a function call, with each parameter representing each dimension of
71
-
the array access, but there is no way to write to such a property.
52
+
access.
72
53
</para>
73
54
<para>
74
-
PHP 5 introduces the following new features to make your life easier:
55
+
You can:
75
56
<itemizedlist>
76
57
<listitem>
77
58
<para>
...
...
@@ -94,3 +75,24 @@ foreach ($domainObject as $obj) {
94
75
</section>
95
76

96
77
</chapter>
78
+

79
+
<!-- Keep this comment at the end of the file
80
+
Local variables:
81
+
mode: sgml
82
+
sgml-omittag:t
83
+
sgml-shorttag:t
84
+
sgml-minimize-attributes:nil
85
+
sgml-always-quote-attributes:t
86
+
sgml-indent-step:1
87
+
sgml-indent-data:t
88
+
indent-tabs-mode:nil
89
+
sgml-parent-document:nil
90
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
91
+
sgml-exposed-tags:nil
92
+
sgml-local-catalogs:nil
93
+
sgml-local-ecat-files:nil
94
+
End:
95
+
vim600: syn=xml fen fdm=syntax fdl=2 si
96
+
vim: et tw=78 syn=sgml
97
+
vi: ts=1 sw=1
98
+
-->
97
99