|
Ds\Set::addAdds values to the set 説明
public void Ds\Set::add(mixed
...$values)Adds all given values to the set that haven't already been added.
警告
All comparisons are strict (type and value). パラメータ
戻り値値を返しません。 例例1 Ds\Set::add example using integers 上の例の出力は、 たとえば以下のようになります。
object(Ds\Set)#1 (5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
string(1) "1"
[4]=>
bool(true)
}
例2 Ds\Set::add example using objects 上の例の出力は、 たとえば以下のようになります。
object(Ds\Set)#1 (5) {
[0]=>
object(ArrayIterator)#2 (1) {
["storage":"ArrayIterator":private]=>
array(0) {
}
}
[1]=>
object(stdClass)#3 (0) {
}
[2]=>
object(stdClass)#4 (0) {
}
[3]=>
object(HashableObject)#5 (1) {
["value":"HashableObject":private]=>
int(1)
}
[4]=>
object(HashableObject)#6 (1) {
["value":"HashableObject":private]=>
int(2)
}
}
|