Documentation

Debug
in package

Useful methods for debugging

Table of Contents

Methods

pre()  : string
Wraps a value in <pre> tags and calls print_r to show all of its data.
table()  : string
Converts a DB result set or similar multi-dimensional array into HTML for a table
type()  : string
Determines the type of a variable.

Methods

pre()

Wraps a value in <pre> tags and calls print_r to show all of its data.

public static pre(mixed $val) : string

N.B. Boolean and null values are displayed as strings instead of merely returning an empty

.

Parameters
$val : mixed
Return values
string —

HTML

table()

Converts a DB result set or similar multi-dimensional array into HTML for a table

public static table(array<string|int, mixed>|PDOStatement $data) : string
Parameters
$data : array<string|int, mixed>|PDOStatement

If a PDOStatement, the cursor will automatically be closed after rendering

Return values
string

type()

Determines the type of a variable.

public static type(mixed $val) : string

For objects, the class name is returned. For other variable types, the type and possibly some extra info about its value is returned.

Parameters
$val : mixed
Return values
string —

Plain text

On this page

Search results