PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/spl/tests/bug54971.php

http://github.com/facebook/hiphop-php
PHP | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | 83bebb68b852c831b3b7922431e3afbb MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. <<__EntryPoint>> function main(): void {
  3. $source = <<<XML
  4. <root>
  5. <node>val1</node>
  6. <node>val2</node>
  7. </root>
  8. XML;
  9. $doc = new DOMDocument();
  10. $doc->loadXML($source);
  11. $xpath = new DOMXPath($doc);
  12. $items = $xpath->query('//node');
  13. print_r(array_map('get_class', iterator_to_array($items, false)));
  14. print_r(array_map('get_class', iterator_to_array($items, true)));
  15. }