005.phpt 687 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. XMLReader: libxml2 XML Reader, parser property set/get
  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. $a = $reader->setParserProperty(XMLReader::LOADDTD, false);
  12. $b = $reader->getParserProperty(XMLReader::LOADDTD);
  13. if (!$a && !$b) {
  14. echo "ok\n";
  15. }
  16. $a = $reader->setParserProperty(XMLReader::SUBST_ENTITIES, true);
  17. $b = $reader->getParserProperty(XMLReader::SUBST_ENTITIES);
  18. if ($a && $b) {
  19. echo "ok\n";
  20. }
  21. // Only go through
  22. while ($reader->read());
  23. $reader->close();
  24. ?>
  25. ===DONE===
  26. --EXPECT--
  27. ok
  28. ===DONE===