php-src/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt
2013-03-19 14:46:21 +01:00

14 lines
345 B
PHP

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