3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $bg = array('back1.jpg', 'back2.jpg' ); // array of filenames $i = rand(0, count($bg)-1); // generate random number size of the array $selectedBg = "$bg[$i]"; // set variable equal to which random filename was chosen <script> $('body').css('background', selectedBg); </script> ?>
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '<', expecting end of file in /in/lgidT on line 5
Process exited with code 255.
Output for 5.3.21 - 5.6.16
Parse error: syntax error, unexpected '<' in /in/lgidT on line 5
Process exited with code 255.