Class Phalcon\Debug\Dump

Source on GitHub

Dumps information about a variable(s)

  1. <?php
  2. $foo = 123;
  3. echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");
  1. <?php
  2. $foo = "string";
  3. $bar = ["key" => "value"];
  4. $baz = new stdClass();
  5. echo (new \Phalcon\Debug\Dump())->variables($foo, $bar, $baz);

Methods

public getDetailed ()

public setDetailed (mixed $detailed)

public __construct ([array $styles], [mixed $detailed])

Phalcon\Debug\Dump constructor

public all ()

Alias of variables() method

protected getStyle (mixed $type)

Get style for type

public setStyles ([array $styles])

Set styles for vars type

public one (mixed $variable, [mixed $name])

Alias of variable() method

protected output (mixed $variable, [mixed $name], [mixed $tab])

Prepare an HTML string of information about a single variable.

public variable (mixed $variable, [mixed $name])

Returns an HTML string of information about a single variable.

  1. <?php
  2. echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");

public variables ()

Returns an HTML string of debugging information about any number of variables, each wrapped in a “pre” tag.

  1. <?php
  2. $foo = "string";
  3. $bar = ["key" => "value"];
  4. $baz = new stdClass();
  5. echo (new \Phalcon\Debug\Dump())->variables($foo, $bar, $baz);

public toJson (mixed $variable)

Returns an JSON string of information about a single variable.

  1. <?php
  2. $foo = [
  3. "key" => "value",
  4. ];
  5. echo (new \Phalcon\Debug\Dump())->toJson($foo);
  6. $foo = new stdClass();
  7. $foo->bar = "buz";
  8. echo (new \Phalcon\Debug\Dump())->toJson($foo);