diff options
Diffstat (limited to 'ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt')
-rw-r--r-- | ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt b/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt new file mode 100644 index 0000000000..396f89b491 --- /dev/null +++ b/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt @@ -0,0 +1,13 @@ +--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 |