Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 4
    print_r isn't exactly an alias of var_dump - it outputs in a different format. Notably, the output from var_dump also includes the "type" of each variable. Commented Jan 7, 2013 at 1:30
  • Reference: Comparing PHP's print and echo Commented Jul 11, 2014 at 1:11
  • Another detail to add and that may be useful, is that var_dump truncates very long texts, showing ... and indicating the remaining length, for example: even '... (length = 4482) If you use echo this does not happen. Commented Jan 15, 2019 at 22:52