--TEST-- insertData() negative offset (mod 32) --EXTENSIONS-- dom --SKIPIF-- --FILE-- createComment("foobarbaz"); try { $comment->insertData(-1, "A"); } catch (DOMException $e) { echo $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; $comment->insertData(-(2**32 - 1), "A"); echo $dom->saveHtml($comment), "\n"; echo "--- Legacy behaviour ---\n"; $dom = new DOMDocument; $comment = $dom->createComment("foobarbaz"); try { $comment->insertData(-1, "A"); } catch (DOMException $e) { echo $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; try { $comment->insertData(-(2**32 - 1), "A"); } catch (DOMException $e) { echo $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; ?> --EXPECT-- --- Modern behaviour --- Index Size Error --- Legacy behaviour --- Index Size Error Index Size Error