Overview

Class to help examine and debug variables.

Captures the output of » var_dump() and outputs it to the screen either as plaintext or in HTML format.

For example ...

<?php
require_once 'Solar.php';
Solar::start();

// an array to dump as an example
$example = array(0, 1, 2, 3);

// the hard way
$debug = Solar::factory('Solar_Debug_Var');
$debug->display($example);

// the easy way
Solar::dump($example);

Note also that Solar_Base has a custom dump() method as well, so any class descended from Solar_Base can be dumped directly.

<?php
// an array to dump as an example
$example = Solar::factory('Solar_Example');
$example->dump();

In general, you will never need to instantiate this class, as it is more easily accessed via Solar::dump() and Solar_Base::dump().

Package

This class is part of the Solar_Debug package.

Inheritance:

Configuration Keys

  • output: Output mode. Set to 'html' for HTML; or 'text' for plain text. Default autodetects by SAPI version.

Constants

None.

Public Properties

The Solar_Debug_Var class has no public properties; try the list of all properties.

Public Methods

These are all the public methods in the Solar_Debug_Var class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

display()

Prints the output of Solar_Debug_Var::fetch() with a label.

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

fetch()

Returns formatted output from var_dump().

locale()

Looks up class-specific locale strings based on a key.



Local