|
Ds\Vector::filterCreates a new vector using a callable to determine which values to include Descriptionpublic Ds\Vector Ds\Vector::filter(callable
$callback = ?)Creates a new vector using a callable to determine which values to include. Parameters
Return Values
A new vector containing all the values for which
either the ExamplesExample #1 Ds\Vector::filter example using callback function
The above example will output something similar to: object(Ds\Vector)#3 (2) { [0]=> int(2) [1]=> int(4) } Example #2 Ds\Vector::filter example without a callback function
The above example will output something similar to: object(Ds\Vector)#2 (3) { [0]=> int(1) [1]=> string(1) "a" [2]=> bool(true) } |