Tools
PHP Functions Online
Pick a function, fill in its arguments and run it on real PHP 8.2. Input is sent to our server to run; results come back typed, with warnings shown separately.
- unserialize()
unserialize(string $data, array $options = []): mixedPaste a serialized string and see the PHP value it turns into, with types, notices and the exact error offset.Open sandbox → - json_decode()
json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixedDecode JSON the way PHP does: arrays or stdClass objects, big integers, depth limits and json_last_error_msg().Open sandbox → - preg_match()
preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int|falseTest a PCRE pattern with PHP itself and see the return value plus the full $matches array.Open sandbox → - strtotime()
strtotime(string $datetime, ?int $baseTimestamp = null): int|falseTurn an English date phrase into a Unix timestamp with an explicit time zone and reference time.Open sandbox → - date()
date(string $format, ?int $timestamp = null): stringFormat a Unix timestamp with PHP date() format characters in any time zone.Open sandbox →
Run single PHP functions without writing a script
Each sandbox is a form for one PHP function: fill in the arguments, press Run, and the function is executed by real PHP 8.2 on our server. The result comes back with its PHP type, so int(0), bool(false), string(1) "0" and NULL never look the same.
Notices and warnings are listed separately from the return value, exceptions show their class and message, and every page builds the equivalent PHP snippet you can copy into your own code.
Frequently asked questions
Is my input sent to a server?
Yes. These pages run real PHP 8.2 on the w3docs server, so the text you enter is sent there to run, in a sandbox with no network access. Do not paste passwords, keys or personal data.
How much input can I send?
Up to 6,000 bytes across all text fields, which is about 6,000 characters of plain text (accented letters and emoji take 2 to 4 bytes). Larger input is refused before anything is sent.
Which PHP version runs the code?
PHP 8.2 (the official php:8.2-cli image). There is no version switch.
Why is there no password_hash() sandbox?
Testing it would mean sending a password to a server. Hash passwords locally with php -r instead.