3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <body> <?php // Set a cookie named "abc" with value "abc" that expires in 1 hour setcookie("abc", "abc", time() + 3600); // Check if the cookie 'abc' is set and display message accordingly if (isset($_COOKIE['abc'])) { echo "Hello, visiting again! Cookie value: " . $_COOKIE['abc']; } else { echo "Your first visit."; } ?> </body> </html>
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.21, 8.4.1 - 8.4.7
<!DOCTYPE html> <html> <body> Warning: Cannot modify header information - headers already sent by (output started at /in/vGgJ5:1) in /in/vGgJ5 on line 7 Your first visit. </body> </html>

preferences:
60.61 ms | 406 KiB | 5 Q