1--TEST--
2Dom\HTMLDocument::createFromString() with LIBXML_COMPACT
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\HTMLDocument::createFromString(<<<HTML
9<!DOCTYPE HTML>
10<html>
11<head>
12</head>
13<body>
14    <p> x </p>
15    <p>foo</p>
16    <p>foox</p>
17    <p>fooxx</p>
18    <p>fooxxx</p>
19    <p>fooxxxx</p>
20    <p>fooxxxxx</p>
21    <p>this does not fit</p>
22</body>
23</html>
24HTML, LIBXML_COMPACT);
25
26$xpath = new Dom\XPath($dom);
27foreach ($xpath->query("//*[name()='p']") as $p) {
28    echo $p->textContent, "\n";
29}
30
31?>
32--EXPECT--
33x
34foo
35foox
36fooxx
37fooxxx
38fooxxxx
39fooxxxxx
40this does not fit
41