PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Marco Cesarato   PHP Dumper Var   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Dumper Var
Display a formatted version of variable values
Author: By
Last change: Stable release and removed beta versioning
Date: 5 years ago
Size: 2,128 bytes
 

Contents

Class file image Download

PHP Dumper

Build Status

Version: 1.0.0.8

Github: https://github.com/marcocesarato/PHP-Dumper

Author: Marco Cesarato

Description

This class can display a formatted version of variable values.

It can take the values of one or more variables and generates a string that displays the variable values in a readable format.

Arrays and objects can be traversed recursively to display its member values.

The class can either return a string with the formatted variable values, display it to the current page or even exit the current script.

Requirements

  • php 5.6+

Install

Composer

  1. Install composer
  2. Type `composer require marcocesarato/dumper`
  3. Enjoy

Usage

use marcocesarato\dumper\Dumper;

$arr = [1,2,3,4,5];

$dump = Dumper::get($arr, $arr /, .../); // Get string of dump
Dumper::out($arr /, .../); // Print
Dumper::fatal($arr /, .../); // Print and die

Methods

Dumper

| Method | Parameters | Description | | ----------- | ----------------------------------- | -------------------------------------------------- | | get | mixed $expression [, mixed $... ]<br>return string | Return dump as string | | out | mixed $expression [, mixed $... ]<br>return void | Print dump | | clean | mixed $expression [, mixed $... ]<br>return void | Clean stream (ob_clean) and print dump | | json | mixed $expression [, mixed $... ]<br>return void | Clean stream (ob_clean) and print json dump | | fatal | mixed $expression [, mixed $... ]<br>return void | Print dump and die | | enableHighlight | return void | Enable Highlight (default true) | | disableHighlight | return void | Disable Highlight | | disableHighlight | return void | Disable Highlight | | getDepth | return int | Get Object/Array dump depth | | setDepth | int $depth<br>return void | Set Object/Array dump depth |