Jump to content

Var dump()

From MorDictionary
Revision as of 00:59, 6 May 2026 by MorMythos (talk | contribs) (Created page with "{{Unverified|This entry has not been fully reviewed against official documentation. Use with caution.}} ==var_dump()== ''func.'' [PHP 4, PHP 5, PHP 7, PHP 8] [vɑr dʌmp] ===Plain English=== <code>var_dump()</code> tells a program to reveal exactly what's inside something: a variable, a value, an array, an object, or the result of an expression. Not just the value, but what kind of thing it is and how much of it there is. Hand it the word <code>"pending"</code> and it...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Unverified

var_dump()

func. [PHP 4, PHP 5, PHP 7, PHP 8] [vɑr dʌmp]

Plain English

var_dump() tells a program to reveal exactly what's inside something: a variable, a value, an array, an object, or the result of an expression. Not just the value, but what kind of thing it is and how much of it there is. Hand it the word "pending" and it shouts back: "I'm a string, I have seven letters, and the word is pending." Type, size, and value, all at once.

Definitions

  1. (computing) A PHP debugging function that displays structured information about one or more expressions, including type and value. Accepts variables, literals, arrays, objects, or function results. Arrays and objects are explored recursively, with values indented to show structure. All public, private, and protected properties of objects are returned in the output unless the object implements a __debugInfo() method.

Syntax

var_dump(mixed $value, mixed ...$values): void

  • Accepts one or more expressions to dump.
  • Returns no value.

Example

"The form had been submitting for three days without saving anything. She finally dropped a var_dump($user) at the top of the handler and found it immediately: NULL. The object she had been passing around, calling methods on, treating as a fully formed thing, had never been instantiated. It was nothing. It had always been nothing."

See also