|
Ds\Set::addAdds values to the set. Beschreibung
public void Ds\Set::add
([ mixed
$...values
] )Adds all given values to the set that haven't already been added.
Achtung
All comparisons are strict (type and value). Parameter-Liste
RückgabewerteEs wird kein Wert zurückgegeben. BeispieleBeispiel #1 Ds\Set::add example using integers
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
object(Ds\Set)#1 (5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
string(1) "1"
[4]=>
bool(true)
}
Beispiel #2 Ds\Set::add example using objects
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
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)
}
}
|