import zend simplexml tests
[hiphop-php.git] / hphp / test / zend / bad / ext-simplexml / sxe_004.php
blobf0a05d2681bb856b8ffc9eaf74e566773e5faec0
1 <?php
3 $xml =<<<EOF
4 <?xml version='1.0'?>
5 <!DOCTYPE sxe SYSTEM "notfound.dtd">
6 <sxe id="elem1">
7 Plain text.
8 <elem1 attr1='first'>
9 Bla bla 1.
10 <!-- comment -->
11 <elem2>
12 Here we have some text data.
13 <elem3>
14 And here some more.
15 <elem4>
16 Wow once again.
17 </elem4>
18 </elem3>
19 </elem2>
20 </elem1>
21 <elem11 attr2='second'>
22 Bla bla 2.
23 <elem111>
24 Foo Bar
25 </elem111>
26 </elem11>
27 </sxe>
28 EOF;
30 class SXETest extends SimpleXMLIterator
32 function rewind()
34 echo __METHOD__ . "\n";
35 return parent::rewind();
37 function valid()
39 echo __METHOD__ . "\n";
40 return parent::valid();
42 function current()
44 echo __METHOD__ . "\n";
45 return parent::current();
47 function key()
49 echo __METHOD__ . "\n";
50 return parent::key();
52 function next()
54 echo __METHOD__ . "\n";
55 return parent::next();
57 function hasChildren()
59 echo __METHOD__ . "\n";
60 return parent::hasChildren();
62 function getChildren()
64 echo __METHOD__ . "\n";
65 return parent::getChildren();
69 $sxe = new SXETest((binary)$xml);
70 $rit = new RecursiveIteratorIterator($sxe, RecursiveIteratorIterator::SELF_FIRST);
72 foreach($rit as $data) {
73 var_dump(get_class($data));
74 var_dump(trim($data));
78 ===DONE===