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