3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); $cookie_name = "mysiterandomuser"; $cookie_value = "justanotheruser"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); ob_end_clean(); ob_flush(); ?> <!DOCTYPE html> <html> <body> <?php if(!isset($_COOKIE[$cookie_name])) { echo "Cookie named '" . $cookie_name . "' is not set!"; } else { echo "Cookie '" . $cookie_name . "' is set!<br>"; echo "Value is: " . $_COOKIE[$cookie_name]; } ?> <p><strong>Note:</strong> You might have to reload the page to see the new value of the cookie.</p> </body> </html>

preferences:
34.09 ms | 402 KiB | 5 Q