예제 #1
0
 public function offsetSet($offset, $value)
 {
     $this->ensureValidItemType($value);
     parent::offsetSet($offset, $value);
 }
예제 #2
0
 public function testReverse()
 {
     $items = $this->createRandomItems();
     $item_count = count($items);
     $list = new ArrayList($items);
     $reversed_list = $list->reverse();
     foreach ($reversed_list as $i => $item) {
         $reverse_index = $item_count - $i - 1;
         $this->assertEquals($items[$reverse_index], $item);
     }
 }