3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bufferScrobble($timecode, $artist, $title) { session_start(); if (isset($_SESSION['timecode'])) { echo "coucou"; //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); } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.0.10.0030.04320.19
7.0.00.0130.08020.08
5.6.210.0070.05320.52
5.6.200.0030.05718.18
5.6.190.0130.08020.35
5.6.180.0530.03720.63
5.6.170.0370.06720.46
5.6.160.0070.05320.44
5.6.150.0030.08018.18
5.6.140.0000.04018.18
5.6.130.0030.04018.27
5.6.120.0200.06721.04
5.6.110.0070.03721.04
5.6.100.0100.08021.13
5.6.90.0170.08021.05
5.6.80.0100.07720.50
5.5.350.0300.07320.55
5.5.340.0130.05317.95
5.5.330.0070.07020.41
5.5.320.0300.03720.24
5.5.310.0300.06020.26
5.5.300.0030.06317.98
5.5.290.0030.04017.99
5.5.280.0070.05320.89
5.5.270.0100.07020.81
5.5.260.0100.08320.66
5.5.250.0070.06320.63
5.5.240.0130.07720.25

preferences:
141.28 ms | 1394 KiB | 7 Q