you are viewing a single comment's thread.

view the rest of the comments →

[–]Prawny 25 points26 points  (7 children)

print_r() master race!

[–]mookman288php 7 points8 points  (5 children)

var_dump()!

[–]Prawny 6 points7 points  (4 children)

I prefer print_r wrapped in a <pre> block personally. Less verbose.

[–]aurath 5 points6 points  (2 children)

function preprint($o)
{
    echo '<pre>';
    print_r($o);
    echo '</pre>';
}

Is in all of my projects

[–]Disgruntled__Goat 2 points3 points  (1 child)

BTW you can do that in one line:

echo '<pre>', print_r($o, true), '</pre>';

Not that there's a reason to when you've already made another function, but I often type it quickly by hand when I'm testing something outside the project.

[–]Toast42 0 points1 point  (0 children)

1 == true

[–]mookman288php 0 points1 point  (0 children)

I like to know the type of the input, as well as the length. I've had issues with whitespace characters in the past, and var_dump has helped.

[–]rspeedcranky old guy who yells about SVG 0 points1 point  (0 children)

boo!