Iterator
in package
Iterator for debugging.
Table of Contents
Properties
- $results : array<string|int, mixed>
- Stores the results of each of the tests.
- $tests : array<string|int, mixed>
- Stores the tests that we are to run.
Methods
- add() : $this
- Adds a test to run.
- getReport() : string
- Get results.
- run() : string|null
- Runs through all of the tests that have been added, recording time to execute the desired number of iterations, and the approximate memory usage used during those iterations.
Properties
$results
Stores the results of each of the tests.
protected
array<string|int, mixed>
$results
= []
$tests
Stores the tests that we are to run.
protected
array<string|int, mixed>
$tests
= []
Methods
add()
Adds a test to run.
public
add(string $name, callable(): mixed $closure) : $this
Tests are simply closures that the user can define any sequence of things to happen during the test.
Parameters
- $name : string
- $closure : callable(): mixed
Return values
$thisgetReport()
Get results.
public
getReport() : string
Return values
stringrun()
Runs through all of the tests that have been added, recording time to execute the desired number of iterations, and the approximate memory usage used during those iterations.
public
run([int $iterations = 1000 ][, bool $output = true ]) : string|null
Parameters
- $iterations : int = 1000
- $output : bool = true