Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

debug.inc

Tadatoshi Tokutake edited this page May 25, 2015 · 10 revisions

Index

Details

withln

string withln(mixed $var)

  • Return the string stringified from $var with a line break.
  • Example:
echo withln(1.0); // => 1.0

echoln

void echoln(mixed $var)

echoln(null); // => null

pretty

string pretty(mixed $var, string $row_prefix = '')

  • Return the pretty string for $var.
  • Example:
echo pretty(['one' => 1, 'two' => 2, 'three' => 3], '-');
// => - (count: 3)[
//    -    'one'   => 1,
//    -    'two'   => 2,
//    -    'three' => 3,
//    - ]

var_detail

string var_detail(mixed $var)

  • Return var_export($var, true).

print_detail

string print_detail(mixed $var)

  • Return print_r($var, true).

html_friendly

string html_friendly(string $string, bool $comment_out = true)

  • Return the string which wrapped by "<pre>" tags.
  • Example:
echo html_friendly('with the comment out');
// => <!--<pre>
//    with the comment out</pre>-->
echo html_friendly('without the comment out', false);
// => <pre>
//    without the comment out</pre>

hf_echoln

void hf_echoln(mixed $var, bool $comment_out = true)

hf_echoln('with comment out');
// => <!--<pre>
//    with comment out
//    </pre>-->

hf_pretty

void hf_pretty(mixed $var, bool $comment_out = true)

hf_var_export

void hf_var_export(mixed $var, bool $comment_out = true)

hf_print_r

void hf_print_r(mixed $var, bool $comment_out = true)

Clone this wiki locally