3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Step 1: Set the cookie BEFORE any HTML output setcookie("abc", "abc_value", time() + 3600); // expires in 1 hour ?> <!DOCTYPE html> <html> <head> <title>PHP Cookie Example</title> </head> <body> <?php // Step 2: Check if cookie is set and display message if (isset($_COOKIE['abc'])) { echo "Hello, visiting again! Cookie value: " . $_COOKIE['abc']; } else { echo "Your first visit."; } ?> </body> </html>
Output for git.master_jit, git.master
<!DOCTYPE html> <html> <head> <title>PHP Cookie Example</title> </head> <body> Your first visit. </body> </html>

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:
29.89 ms | 405 KiB | 5 Q