1--TEST-- 2substringData() 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->substringData(0, 2**31+1)); 14} catch (DOMException $e) { 15 echo $e->getMessage(), "\n"; 16} 17try { 18 var_dump($comment->substringData(2**31+1, 0)); 19} catch (DOMException $e) { 20 echo $e->getMessage(), "\n"; 21} 22try { 23 var_dump($comment->substringData(100, 0)); 24} catch (DOMException $e) { 25 echo $e->getMessage(), "\n"; 26} 27echo $dom->saveHtml($comment), "\n"; 28 29?> 30--EXPECT-- 31Index Size Error 32Index Size Error 33Index Size Error 34<!--foobarbaz--> 35