コード例 #1
0
 public function hashSetUsableInForeach()
 {
     $s = new HashSet();
     $s->addAll(array(new String('0'), new String('1'), new String('2')));
     foreach ($s as $i => $element) {
         $this->assertEquals(new String($i), $element);
     }
 }
コード例 #2
0
 public function hashSetUsableInForeach()
 {
     $s = new HashSet();
     $s->addAll([new Name('0'), new Name('1'), new Name('2')]);
     foreach ($s as $i => $element) {
         $this->assertEquals(new Name($i), $element);
     }
 }