6

var_dump() or print_r()?

Comments
  • 1
    Serialize. You can reuse the output.
  • 2
    Testing in web: echo '<pre>',print_r($array),'</pre>';

    Testing in command line: echo print_r($array);

    I prefer print_r
  • 2
    @Devnergy
    Besides var_dump always echos and needs ob_clean(), I rather use print_r too, easier to capture and reformat.
  • 1
    I use var dump, no particular reason.
  • 1
    var_dump() empowered with xdebug. Nicely formatted with colors ;)
Add Comment