3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once 'config.php'; require_once 'functions.php'; if($_GET['url']){ $track_url = $_GET['url']; $track_url = trim($track_url); } if(!$track_url){ header("Location: /?utm_source=noinput"); exit(); } if((!filter_var($track_url, FILTER_VALIDATE_URL)) && (!empty($track_url))){ $error="Invalid URL"; } if(!$error){ $url="http://api.soundcloud.com/resolve.json?url=".$track_url."&client_id=".$client_id; $response_code=check_url($url); if($response_code==404){ $error="Playlist not found"; } if($response_code==400){ $error="Bad URL (#400)"; } } if(!$error){ $headers1=get_headers($url,1); $location1=$headers1['Location']; if(!$location1){ $headers1=get_headers($url,1); $location1=$headers1['Location']; } } if($location1){ $json = file_get_contents_curl($location1) or error_log("download error for $url"); if(!$json){ $json = file_get_contents_curl($location1) or error_log("download error again for $url"); } if(!$json){ header("Location: /?error=1&utm_source=downloaderror"); exit(); } } else { $error="Unable to get playlist data"; } if(!$error){ $obj = json_decode($json, true); $kind=$obj['kind']; if($kind!='playlist'){ $error="Not a playlist!"; } } if(!$error){ $id=$obj['id']; $title=$obj['title']; $sclink=$obj['permalink_url']; $buy=$obj['purchase_url']; $user=$obj['user']; $user_id=$user['id']; $user=$user['username']; $duration=$obj['duration']; $description=$obj['description']; $tracks=$obj['tracks']; $pic=$obj['artwork_url']; $pic300=$pic; $pagetitle="$title - $user | $sitename"; $description="Download $title for free. Listen to $title or download $title. $title Mp3, audio music. Download music using SC-DOWNLOADER.COM fast, simple and free."; $metakeywords="$title, $user, $title by $user, $title Mp3, $title music, download $title, audio music, sc-downloader.com"; $description=str_replace('"', '\'', $description); $metakeywords=str_replace('"', '\'', $metakeywords); } else { $pagetitle="Error! | $sitename"; } $head_include_html=<<<EOF <meta itemprop="name" content="$title" /> <meta itemprop="description" content="$description" /> <meta itemprop="image" content="$pic300" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="$title" /> <meta name="twitter:description" content="$description" /> <meta name="twitter:image:src" content="$pic300" /> <meta name="twitter:domain" content="sc-downloader.com" /> <meta property="og:title" content="$title" /> <meta property="og:type" content="music.song" /> <meta property="og:description" content="$description" /> <meta property="og:image" content="$pic300" /> <meta property="og:url" content="http://sc-downloader.com/playlist/$title-$id.html" /> <meta property="og:site_name" content="$sitename" /> <meta property="og:see_also" content="http://sc-downloader.com" /> <meta property="fb:admins" content="100001767032587" /> <link rel="canonical" href="http://sc-downloader.com/playlist/$title-$id.html" /> EOF; require_once("assets/header.php"); ?> <?php if($error){ echo "<h2>Error!</h2>"; echo "<p class='error'><b>Error!</b> ".$error."</p>"; } else { echo "<h2>$title <small> ($user) </small></h2>"; echo "<p>$description</p>"; if(!is_array($tracks)) { echo "<p class='error'>Unable to fetch playlist. Please try again!</p>"; } else { echo "<h2>Tracks</h2>"; foreach($tracks as $track){ $link=urlencode($track['permalink_url']); $html=<<<EOF <a href="/download.php?url=$link&amp;utm_source=playlist_downloader">Download $title</a> <br/> EOF; } } } ?> <?php require_once("assets/footer.php"); ?>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: require_once(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Dch6P on line 3 Warning: require_once(config.php): Failed to open stream: Operation not permitted in /in/Dch6P on line 3 Fatal error: Uncaught Error: Failed opening required 'config.php' (include_path='.:') in /in/Dch6P:3 Stack trace: #0 {main} thrown in /in/Dch6P on line 3
Process exited with code 255.
Output for 8.0.13
Warning: require_once(config.php): Failed to open stream: No such file or directory in /in/Dch6P on line 3 Fatal error: Uncaught Error: Failed opening required 'config.php' (include_path='.:') in /in/Dch6P:3 Stack trace: #0 {main} thrown in /in/Dch6P on line 3
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: require_once(config.php): failed to open stream: No such file or directory in /in/Dch6P on line 3 Fatal error: require_once(): Failed opening required 'config.php' (include_path='.:') in /in/Dch6P on line 3
Process exited with code 255.
Output for 7.3.16 - 7.3.31, 7.4.3 - 7.4.32
Warning: require_once(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Dch6P on line 3 Warning: require_once(config.php): failed to open stream: Operation not permitted in /in/Dch6P on line 3 Fatal error: require_once(): Failed opening required 'config.php' (include_path='.:') in /in/Dch6P on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.34, 7.2.29 - 7.2.33
Parse error: syntax error, unexpected end of file in /in/Dch6P on line 149
Process exited with code 255.
Output for 4.4.3 - 4.4.9, 5.1.0 - 5.1.1, 5.1.3 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected $end in /in/Dch6P on line 149
Process exited with code 255.
Output for 4.4.2, 5.1.2
Parse error: syntax error, unexpected $end in /in/Dch6P on line 150
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected $ in /in/Dch6P on line 149
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Dch6P on line 149
Process exited with code 255.

preferences:
176.86 ms | 401 KiB | 256 Q