|
Ds\Vector::filterCreates a new vector using a callable to determine which values to include. Beschreibung
public Ds\Vector Ds\Vector::filter
([ callable
$callback
] )Creates a new vector using a callable to determine which values to include. Parameter-Liste
Rückgabewerte
A new vector containing all the values for which
either the BeispieleBeispiel #1 Ds\Vector::filter example using callback function
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
object(Ds\Vector)#3 (2) {
[0]=>
int(2)
[1]=>
int(4)
}
Beispiel #2 Ds\Vector::filter example without a callback function
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
object(Ds\Vector)#2 (3) {
[0]=>
int(1)
[1]=>
string(1) "a"
[2]=>
bool(true)
}
|