<?php
class Root
{
public int $id;
public string $name;
public string $email;
public bool $active;
public float $score;
public Address $address;
public array $tags;
public function __construct(
int $id,
string $name,
string $email,
bool $active,
float $score,
Address $address,
array $tags
) {
$this->id = $id;
$this->name = $name;
$this->email = $email;
$this->active = $active;
$this->score = $score;
$this->address = $address;
$this->tags = $tags;
}
}
class Address
{
public string $street;
public string $city;
public function __construct(
string $street,
string $city
) {
$this->street = $street;
$this->city = $city;
}
}FAQ
What PHP version is the output for?
Are nested objects handled?
Is a constructor generated?
Get a free API key + new tools as they ship
100 calls/day, no card, no spam. Built by one person, in public.
About JSON to PHP
JSON to PHP was built for the moment you just need to handle this task and move on — no signup, no upload to a third-party server. Processing runs locally in your browser using modern Web APIs. Nothing is uploaded, nothing is logged, and there is no quota to worry about for casual use. It is one of about a hundred utility tools that share the same philosophy: do one thing, do it well, get out of your way.
When you'd reach for JSON to PHP
You need to handle a one-off task right before a meeting and don't have time to install anything.
Anyone working remotely on a borrowed or restricted machine.
Open the page, get the result, paste it into your doc — under a minute.
You're cleaning up a folder of files that accumulated over a project and need to standardize them.
Designers, writers, and developers wrapping up deliverables.
Drop each file in, copy the output, move on.
You're hitting the daily limit of a paid SaaS and need a backup option for a single quick job.
Marketers and ops people whose primary tool is metered.
Stay productive without burning credits.
You're on a public or shared machine and don't want to leave traces of what you're working on.
Travelers, contractors, anyone working from a friend's computer.
Nothing is uploaded, nothing persists if you're not signed in.
Frequently asked about JSON to PHP
- Are my files uploaded to a server when I use JSON to PHP?
- JSON to PHP processes everything in your browser using local APIs. Your files never leave your device.
- What browsers does JSON to PHP support?
- Every modern browser released in the last three years: Chrome, Firefox, Safari, Edge, Brave, Opera.
- Is JSON to PHP really free?
- Yes — JSON to PHP is free for unlimited personal use, with no account required and no watermark on the output.
- Do I need to create an account to use JSON to PHP?
- No. JSON to PHP works without any signup. We only ask for an email if you decide to subscribe to a paid plan.
- Does JSON to PHP work on mobile?
- Yes, JSON to PHP is fully responsive and tested on iOS Safari and Android Chrome.
