Skip to content

Commit

Permalink
iteratoraggregate.xml: formatted the example code
Browse files Browse the repository at this point in the history
  • Loading branch information
mumumu committed Apr 28, 2024
1 parent 7b2dc44 commit d041b3d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions language/predefined/iteratoraggregate.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f94d903985119d3ac00f4528551df947f57b667f Maintainer: satoruyoshida Status: ready -->
<!-- EN-Revision: 20b4b383127faaf37495d7746885f2bb674a1a33 Maintainer: satoruyoshida Status: ready -->
<phpdoc:classref xml:id="class.iteratoraggregate" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

<title>IteratorAggregate インターフェイス</title>
Expand Down Expand Up @@ -47,27 +47,32 @@
<programlisting role="php">
<![CDATA[
<?php
class myData implements IteratorAggregate {
class myData implements IteratorAggregate
{
public $property1 = "Public property one";
public $property2 = "Public property two";
public $property3 = "Public property three";
public $property4 = "";
public function __construct() {
public function __construct()
{
$this->property4 = "last property";
}
public function getIterator(): Traversable {
public function getIterator(): Traversable
{
return new ArrayIterator($this);
}
}
$obj = new myData;
$obj = new myData();
foreach($obj as $key => $value) {
foreach ($obj as $key => $value) {
var_dump($key, $value);
echo "\n";
}
?>
]]>
</programlisting>
Expand Down

0 comments on commit d041b3d

Please sign in to comment.