Skip to content

Commit 6b9754d

Browse files
committed
Merge branch '4.4'
* 4.4: Show DomCrawler results consistent
2 parents 6037185 + 4027518 commit 6b9754d

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

components/dom_crawler.rst

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -346,30 +346,34 @@ This behavior is best illustrated with examples::
346346
$crawler->addHtmlContent($html);
347347

348348
$crawler->filterXPath('//span[contains(@id, "article-")]')->evaluate('substring-after(@id, "-")');
349-
/* array:3 [
350-
0 => "100"
351-
1 => "101"
352-
2 => "102"
353-
]
349+
/* Result:
350+
[
351+
0 => '100',
352+
1 => '101',
353+
2 => '102',
354+
];
354355
*/
355356

356357
$crawler->evaluate('substring-after(//span[contains(@id, "article-")]/@id, "-")');
357-
/* array:1 [
358-
0 => "100"
358+
/* Result:
359+
[
360+
0 => '100',
359361
]
360362
*/
361363

362364
$crawler->filterXPath('//span[@class="article"]')->evaluate('count(@id)');
363-
/* array:3 [
364-
0 => 1.0
365-
1 => 1.0
366-
2 => 1.0
365+
/* Result:
366+
[
367+
0 => 1.0,
368+
1 => 1.0,
369+
2 => 1.0,
367370
]
368371
*/
369372

370373
$crawler->evaluate('count(//span[@class="article"])');
371-
/* array:1 [
372-
0 => 3.0
374+
/* Result:
375+
[
376+
0 => 3.0,
373377
]
374378
*/
375379

0 commit comments

Comments
 (0)