PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/dom/tests/bug47430.php

http://github.com/facebook/hiphop-php
PHP | 17 lines | 13 code | 4 blank | 0 comment | 0 complexity | 245c5321e1910dc27c8ac7ba7d5e4c12 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. <?php
  2. $xml = '<?xml
  3. version="1.0"?><html><p><i>Hello</i></p><p><i>World!</i></p></html>';
  4. $dom = new DOMDocument();
  5. $dom->loadXML($xml);
  6. $elements = $dom->getElementsByTagName('i');
  7. foreach ($elements as $i) {
  8. $i->previousSibling->nodeValue = '';
  9. }
  10. $arr = array();
  11. $arr[0] = 'Value';
  12. print_r($arr);
  13. ?>