Syntax: ofType (type)
The ofType method returns only elements of the specified type. To instead receive an error if an element cannot be cast, use {@link cast}.
public ofType ( string $type ) : |
||
$type | string | The type to filter the elements of the sequence on. Can be either class name or one of the predefined types: array, int (integer, long), callable (callable), float (real, double), null, string, object, numeric, scalar. |
return | A sequence that contains elements from the input sequence of the specified type. |