3v4l.org

run code in 300+ PHP versions simultaneously
<?php $STATS_FILE = 'http://89.223.41.232:8000/status.xsl'; $DOCROOT = '/var/www/ideep1ru/playingnow/info'; // Корень сайта $hostname = "89.223.41.232"; $username = "radio"; // Имя пользователя для БД $password = "radio"; // И пароль $dbName = "radio"; // Имя БД $last1="http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=601f627a9fbb34ef24bc288cad4976e9&artist="; $last2="&track="; $spotify1="https://itunes.apple.com/search?term="; $spotify2=" - "; $spotify3="&limit=1"; $mysql_con = mysqli_connect($hostname,$username,$password,$dbName) OR die("Can't connect to database."); mysqli_select_db($mysql_con, $dbName) or die(mysql_error()); mysqli_query($mysql_con,"SET NAMES 'cp1251';"); mysqli_query($mysql_con,"SET CHARACTER SET 'cp1251';"); mysqli_query($mysql_con,"SET SESSION collation_connection = 'cp1251_general_ci';"); $fp = fopen($STATS_FILE,'r'); if(!$fp) { die("Unable to connect to Icecast server."); } $stats_file_contents = ''; while(!feof($fp)) { $stats_file_contents .= fread($fp,1024); } fclose($fp); $radio_info = array(); $radio_info['genre'] = ''; $radio_info['listeners'] = ''; $radio_info['now_playing'] = ''; $temp = array(); $search_for = "<td\s[^>]*class=\"streamdata\">(.*)<\/td>"; $search_td = array('<td class="streamdata">','</td>'); if(preg_match_all("/$search_for/siU",$stats_file_contents,$matches)) { foreach($matches[0] as $match) { $to_push = str_replace($search_td,'',$match); $to_push = trim($to_push); array_push($temp,$to_push); } } $radio_info['listeners'] = $temp[4]; $radio_info['genre'] = $temp[6]; //$radio_info['now_playing'] = $temp[8]; //$radio_info['now_playing'] = $temp[8]; $radio_info['info']['now_playing'] = $temp[8]; $x = explode(" - ",$temp[8]); $artist1 = $x[0]; $song1 = $x[1]; $artist1 = str_replace('&amp;', 'and', $artist1); $song1 = str_replace('&amp;', 'and', $song1); $ttt =" - "; $title = $artist1.$ttt.$song1; $img640_url= "https://i.deep1.ru/playingnow/logo_default.png"; $img300_url= "https://i.deep1.ru/playingnow/logo_default.png"; $img64_url= "https://i.deep1.ru/playingnow/logo_default.png"; echo $spotify_url=$spotify1.$artist1.$spotify2.$song1.$spotify3 ; echo $spotify_url = str_replace(' ', '+', $spotify_url); //$spotify_url = "https://itunes.apple.com/search?term=Kylie+Minogue"; $ch = curl_init($spotify_url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $spotify = curl_exec($ch); curl_close($ch); $obj = json_decode($spotify); //$total = $obj->resultCount->results; //$img640_url = $obj->resultCount[0]->results[1]->artworkUrl100; echo $img640_url;
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/vgjoA:18 Stack trace: #0 {main} thrown in /in/vgjoA on line 18
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/vgjoA:18 Stack trace: #0 {main} thrown in /in/vgjoA on line 18
Process exited with code 255.

preferences:
183.01 ms | 402 KiB | 211 Q