php-src/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt

14 lines
320 B
Plaintext
Raw Normal View History

--TEST--
Check that SplDoublyLinkedList::add throws an exception with an invalid offset argument
--FILE--
<?php
try {
$dll = new SplDoublyLinkedList();
var_dump($dll->add(NULL,2));
} catch (OutOfRangeException $e) {
echo "Exception: ".$e->getMessage()."\n";
}
?>
--EXPECTF--
Exception: Offset invalid or out of range