001.phpt 532 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. XMLReader: libxml2 XML Reader, string data
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xmlreader")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
  8. <books></books>';
  9. $reader = new XMLReader();
  10. $reader->XML($xmlstring);
  11. // Only go through
  12. while ($reader->read()) {
  13. echo $reader->name."\n";
  14. }
  15. $xmlstring = '';
  16. $reader = new XMLReader();
  17. $reader->XML($xmlstring);
  18. ?>
  19. ===DONE===
  20. --EXPECTF--
  21. books
  22. books
  23. Warning: XMLReader::XML(): Empty string supplied as input in %s on line %d
  24. ===DONE===