1--TEST--
2insertData() edge cases
3--EXTENSIONS--
4dom
5--SKIPIF--
6<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only"); ?>
7--FILE--
8<?php
9
10$dom = Dom\HTMLDocument::createEmpty();
11$comment = $dom->createComment("foobarbaz");
12try {
13    var_dump($comment->insertData(100, "data"));
14} catch (DOMException $e) {
15    echo $e->getMessage(), "\n";
16}
17try {
18    var_dump($comment->insertData(2**31+1, "data"));
19} catch (DOMException $e) {
20    echo $e->getMessage(), "\n";
21}
22echo $dom->saveHtml($comment), "\n";
23
24?>
25--EXPECT--
26Index Size Error
27Index Size Error
28<!--foobarbaz-->
29