1--TEST--
2substringData() negative arguments
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\HTMLDocument::createEmpty();
9$comment = $dom->createComment("foobarbaz");
10var_dump($comment->substringData(0, -1));
11echo $dom->saveHtml($comment), "\n";
12var_dump($comment->substringData(2, -2));
13echo $dom->saveHtml($comment), "\n";
14try {
15    var_dump($comment->substringData(-2, 2));
16} catch (DOMException $e) {
17    echo $e->getMessage(), "\n";
18}
19echo $dom->saveHtml($comment), "\n";
20
21?>
22--EXPECT--
23string(9) "foobarbaz"
24<!--foobarbaz-->
25string(7) "obarbaz"
26<!--foobarbaz-->
27Index Size Error
28<!--foobarbaz-->
29