FilteredIterator
extends ArrayIterator
in package
FinalYes
Iterator for arrays requiring filtered values
Table of Contents
Properties
- $callback : callable
- Callback to run as a filter
Methods
- __construct() : mixed
- Create a new iterator
- __unserialize() : void
- Prevent unserialization of the object for security reasons.
- __wakeup() : void
- Perform reinitialization tasks.
- current() : string
- Get the current item's value after filtering
- unserialize() : void
- Prevent creating a PHP value from a stored representation of the object for security reasons.
Properties
$callback
Callback to run as a filter
private
callable
$callback
Methods
__construct()
Create a new iterator
public
__construct(array<string|int, mixed> $data, callable $callback) : mixed
Parameters
- $data : array<string|int, mixed>
-
The array or object to be iterated on.
- $callback : callable
-
Callback to be called on each value
Tags
__unserialize()
Prevent unserialization of the object for security reasons.
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
-
Restored array of data originally serialized.
Tags
Attributes
__wakeup()
Perform reinitialization tasks.
public
__wakeup() : void
Prevents a callback from being injected during unserialization of an object.
current()
Get the current item's value after filtering
public
current() : string
Attributes
Return values
stringunserialize()
Prevent creating a PHP value from a stored representation of the object for security reasons.
public
unserialize(string $data) : void
Parameters
- $data : string
-
The serialized string.