3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bufferScrobble($timecode, $artist, $title) { session_start(); if (isset($_SESSION['timecode'])) { //Chanson bufferisée if($timecode == $_SESSION['timecode']) { //Même chanson, bonne à scrobbler echo "scrobble ".$_SESSION['timecode']." ".$_SESSION['artist']." ".$_SESSION['title']; session_destroy(); } else if(($timecode - $_SESSION['timecode']) < 0) { //Une chanson revient après ses +30sec mais on est déjà passé à la suivante break; } else if(($timecode - $_SESSION['timecode']) < 30) { //Chanson bufferisée trop courte, on passe à la nouvelle $_SESSION['timecode'] == $timecode; $_SESSION['artist'] == $artist; $_SESSION['title'] == $title; session_write_close(); sleep(30); bufferScrobble($timecode, $artist, $title); } else { //Chanson bufferisée suffisamment longue, on la scrobble et on bufferise la nouvelle echo "scrobble ".$_SESSION['timecode']." ".$_SESSION['artist']." ".$_SESSION['title']; $timecode == $_SESSION['timecode']; $artist == $_SESSION['artist']; $title == $_SESSION['title']; session_write_close(); sleep(30); bufferScrobble($timecode, $artist, $title); } } else { $_SESSION['timecode'] == $timecode; $_SESSION['artist'] == $artist; $_SESSION['title'] == $title; session_write_close(); sleep(30); bufferScrobble($timecode, $artist, $title); } } ?>
Output for 7.0.0 - 7.0.1
Fatal error: 'break' not in the 'loop' or 'switch' context in /in/MFXbK on line 14
Process exited with code 255.
Output for 5.3.21 - 5.6.28