3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Create an array and push on the names // of your closest family and friends $name = array(); array_push($name,"Mike"); array_push($name,"Jane"); array_push($name,"Jack"); array_push($name,"Nike"); array_push($name,"Ash"); array_push($name,"Chris"); array_push($name,"Zark"); // Sort the list sort($name); join(",",$name); // Randomly select a winner! $random = count($name,rand(0,7)); // Print the winner's name in ALL CAPS $winner = strtoupper($random); print($winner); ?>
Output for 4.3.0 - 7.1.0
7