|
Ds\Sequence::filterCreates a new sequence using a callable to determine which values to include. Beschreibung
abstract public Ds\Sequence Ds\Sequence::filter
([ callable
$callback
] )Creates a new sequence using a callable to determine which values to include. Parameter-Liste
Rückgabewerte
A new sequence containing all the values for which
either the BeispieleBeispiel #1 Ds\Sequence::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\Sequence::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)
}
|