3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP // Shoutcast Server Stats // Parses shoutcasts xml to make an effective stats thing for any website // ©2004-2005 Daniel Brown http://www.gmtt.co.uk // Please refer to the readme file for use. include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30); if(!$scfp) { $scsuccs=1; $locutor = 'Sin Locutor'; $actuals = 'Sin Cancion Actual'; $canciones = ' <b>1.</b> Sin Canciones Pasadas <BR><BR> <b>2.</b> Sin Canciones Pasadas <BR><BR> <b>3.</b> Sin Canciones Pasadas <BR><BR> <b>4.</b> Sin Canciones Pasadas <BR><BR> <b>5.</b> Sin Canciones Pasadas <BR><BR>' ; } if($scsuccs!=1){ fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= fgets($scfp, 1000); } ######################################################## /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\ //define xml elements $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS"); $y=0; while($loop[$y]!=''){ $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) $$scphp = urldecode($$scphp); // uncomment the next line to see all variables //echo'$'.$scphp.' = '.$$scphp.'<br>'; $y++; } //end intro xml elements ######################################################## ######################################################## /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\ //get song info and history $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); $songatime = explode("<SONG>", $pageed); $r=1; while($songatime[$r]!=""){ $t=$r-1; $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]); $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]); $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]); $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page); $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed); $r++; } //end song info fclose($scfp); } //display stats if($streamstatus == "1"){ //you may edit the html below, make sure to keep variable intact $locutor = ''.$servertitle.''; $actuals = ''.$song[0].''; $canciones = ' <b>1.</b> '.$song[1].'<BR><BR> <b>2.</b> '.$song[2].'<BR><BR> <b>3.</b> '.$song[3].'<BR><BR> <b>4.</b> '.$song[4].'<BR><BR> <b>5.</b> '.$song[5].'<BR><BR>' ; } if($streamstatus == "0") { //you may edit the html below, make sure to keep variable intact $locutor = 'Sin Locutor'; $actuals = 'Sin Cancion Actual'; $canciones = ' <b>1.</b> Sin Canciones Pasadas <BR><BR> <b>2.</b> Sin Canciones Pasadas <BR><BR> <b>3.</b> Sin Canciones Pasadas <BR><BR> <b>4.</b> Sin Canciones Pasadas <BR><BR> <b>5.</b> Sin Canciones Pasadas <BR><BR>' ; } ?>
Output for 5.4.0 - 5.4.23
Fatal error: Call-time pass-by-reference has been removed in /in/t3dOl on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/t3dOl on line 7 Deprecated: Call-time pass-by-reference has been deprecated in /in/t3dOl on line 7 Warning: include(config_radio.php): failed to open stream: No such file or directory in /in/t3dOl on line 6 Warning: include(): Failed opening 'config_radio.php' for inclusion (include_path='.:') in /in/t3dOl on line 6 Notice: Undefined variable: scip in /in/t3dOl on line 7 Notice: Undefined variable: scport in /in/t3dOl on line 7 Warning: fsockopen(): unable to connect to :0 (Failed to parse address "") in /in/t3dOl on line 7 Notice: Undefined variable: streamstatus in /in/t3dOl on line 67 Notice: Undefined variable: streamstatus in /in/t3dOl on line 81

preferences:
195.56 ms | 1396 KiB | 61 Q