3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('FIELDS', ['name', 'address', 'city']); define( 'HTML_FIELD_FORM', <<<'HTML' <h2>%1$s</h2> <form method="post" autocomplete="off"> <input type="text" name="%1$s" autocomplete="off" placeholder="%1$s"><br> <input value="submit" type="submit"> </form> HTML ); define( 'HTML_CLEAR_FORM', <<<'HTML' <form method="post" autocomplete="off"> <input type="text" name="%1$s" value="1" hidden><br> <input value="%1$s" type="submit"> </form> HTML ); foreach (FIELDS as $field) { if (isset($_POST[$field])) { // Set session & cookie from post $_SESSION[$field] = $_POST[$field]; setcookie($field, $_POST[$field]); } elseif (isset($_COOKIE[$field])) { // Set session from cookie $_SESSION[$field] = $_COOKIE[$field]; } elseif (!isset($_SESSION[$field])) { // Present individual field form printf(HTML_FIELD_FORM, $field); } } foreach (['clear_session', 'clear_cookies'] as $action) { printf(HTML_CLEAR_FORM, $action); }
Output for git.master_jit, git.master
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
<h2>name</h2> <form method="post" autocomplete="off"> <input type="text" name="name" autocomplete="off" placeholder="name"><br> <input value="submit" type="submit"> </form><h2>address</h2> <form method="post" autocomplete="off"> <input type="text" name="address" autocomplete="off" placeholder="address"><br> <input value="submit" type="submit"> </form><h2>city</h2> <form method="post" autocomplete="off"> <input type="text" name="city" autocomplete="off" placeholder="city"><br> <input value="submit" type="submit"> </form><form method="post" autocomplete="off"> <input type="text" name="clear_session" value="1" hidden><br> <input value="clear_session" type="submit"> </form><form method="post" autocomplete="off"> <input type="text" name="clear_cookies" value="1" hidden><br> <input value="clear_cookies" type="submit"> </form>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.45 ms | 402 KiB | 8 Q