1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt
Máté Kocsis f7fbc6333f Add more precise type info for stubs
Closes GH-6005
2020-09-01 16:35:56 +02:00

24 lines
556 B
PHP

--TEST--
Check that SplDoublyLinkedList->offsetUnset() returns an error message when the offset is < 0.
--CREDITS--
PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com )
--FILE--
<?php
// Create a new Doubly Linked List
$dll = new SplDoublyLinkedList();
// Add some items to the list
$dll->push(1);
$dll->push(2);
$dll->push(3);
try {
$dll->offsetUnset(-1);
}
catch (Exception $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range