1--TEST--
2deleteData() negative in bounds length
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8echo "--- Modern behaviour ---\n";
9
10$dom = Dom\HTMLDocument::createEmpty();
11$comment = $dom->createComment("foobarbaz");
12$comment->deleteData(3, -1);
13echo $dom->saveHtml($comment), "\n";
14
15echo "--- Legacy behaviour ---\n";
16
17$dom = new DOMDocument;
18$comment = $dom->createComment("foobarbaz");
19try {
20    $comment->deleteData(3, -1);
21} catch (DOMException $e) {
22    echo $e->getMessage(), "\n";
23}
24echo $dom->saveHtml($comment), "\n";
25
26?>
27--EXPECT--
28--- Modern behaviour ---
29<!--foo-->
30--- Legacy behaviour ---
31Index Size Error
32<!--foobarbaz-->
33