3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php session_start(); ?> <!DOCTYPE html> <html> <body> <?php session_start(); $_SESSION["favcolor"] = "green"; $_SESSION["favanimal"] = "cat"; // Echo session variables that were set on previous page echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>"; echo "Favorite animal is " . $_SESSION["favanimal"] . "."; ?> </body> </html>
based on ffMhC
Output for 7.2.0 - 7.3.0rc3
<!DOCTYPE html> <html> <body> Notice: session_start(): A session had already been started - ignoring in /in/OEorC on line 9 Favorite color is green.<br>Favorite animal is cat. </body> </html>
Output for 5.6.0 - 7.1.20
<!DOCTYPE html> <html> <body> Notice: A session had already been started - ignoring session_start() in /in/OEorC on line 9 Favorite color is green.<br>Favorite animal is cat. </body> </html>