I Help You

PHP var_dump() Parser

Parse PHP var_dump() output — including type-annotated strings, ints, floats, booleans, NULL, arrays, and objects — and convert to JSON, JavaScript, Python, or PHP array. Free, and it runs entirely in your browser — nothing you enter is uploaded.

What is it?

PHP's var_dump() function outputs a detailed, type-annotated representation of any variable. Unlike print_r(), it includes explicit type and length information (e.g. string(5) "hello", int(42), bool(true)). This makes it ideal for debugging but harder to consume in other languages.

This tool parses the var_dump() format — including deeply nested arrays and objects of any depth — and converts the result into your chosen target format. Type annotations are stripped and values are mapped to native types in each language.

Example

PHP var_dump() Output
array(3) {
  ["name"]=>
  string(5) "Alice"
  ["age"]=>
  int(30)
  ["scores"]=>
  array(3) {
    [0]=>
    int(95)
    [1]=>
    int(87)
    [2]=>
    int(92)
  }
}
↓
JSON (converted)
{
  "name": "Alice",
  "age": 30,
  "scores": [
    95,
    87,
    92
  ]
}

Switch to JavaScript, Python, or PHP Array output using the format tabs above the result.

Benefits

Share structured data with anyone, in any format

CSV output opens directly in Excel and Google Sheets; XML works with legacy enterprise systems; JSON feeds every modern API — convert to whatever format your audience needs.

Bridge incompatible data formats without a custom script

Convert between JSON, CSV, XML, and YAML in one click — the most common inter-system data translation handled instantly, without writing a parser or ETL pipeline.

Inspect, compare, and debug complex JSON structures

Sort, extract, compare, and measure JSON to find unexpected keys, spot structural differences between API versions, and diagnose oversized payloads.

Migrate legacy data to modern formats

Convert XML configs, PHP print_r() dumps, or CSV exports to clean JSON — without writing a one-off migration script that will never be used again.

Frequently asked questions

What types does var_dump() produce?

var_dump() annotates: string(N) "value", int(N), float(N), bool(true/false), NULL, array(N) { ... }, and object(ClassName)#id (N) { ... }. All are handled by this parser.

How is this different from the print_r() parser?

print_r() outputs simplified key => value pairs with no type info. var_dump() wraps each value with its type and (for strings) byte length. The parsers use different grammars — use this tool specifically for var_dump() output.

Are nested arrays and objects supported?

Yes — arrays and objects nested at any depth are fully parsed. The parser recursively processes each { } block, matching key lines and their typed values.

What happens to object class names?

Object class names and instance IDs (e.g. object(MyClass)#1) are discarded and the object's properties are treated as a plain key-value map, which maps cleanly to a JSON object, JS object, or Python dict.

What if my var_dump output has extra whitespace or indentation?

Lines are trimmed before parsing, so any indentation (spaces or tabs) is ignored. Copy the raw var_dump() output directly — no manual cleanup needed.