W3docs

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.

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.