Silencer
in package
Temporarily suppress PHP error reporting, usually warnings and below.
Tags
Table of Contents
- $stack : array<string|int, int>
- call() : mixed
- Calls a specified function while silencing warnings and below.
- restore() : mixed
- Restores a single state.
- suppress() : int
- Suppresses given mask or errors.
Properties
$stack
private
static array<string|int, int>
$stack
= array()
Unpop stack
Methods
call()
Calls a specified function while silencing warnings and below.
public
static call(callable $callable) : mixed
Future improvement: when PHP requirements are raised add Callable type hint (5.4) and variadic parameters (5.6)
Parameters
- $callable : callable
-
Function to execute.
Tags
Return values
mixed —Return value of the callback.
restore()
Restores a single state.
public
static restore() : mixed
Return values
mixed —suppress()
Suppresses given mask or errors.
public
static suppress([int|null $mask = null ]) : int
Parameters
- $mask : int|null = null
-
Error levels to suppress, default value NULL indicates all warnings and below.
Return values
int —The old error reporting level.