3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function processURL($url) { $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 2 )); $result = curl_exec($ch); curl_close($ch); return $result; } // Tag als parameter auswerten $tag = 'IWH3F04ED0'; //$_GET["ID"]; $status = "0"; $db_server = 'rdbms.strato.de'; $db_benutzer = 'U1248927'; $db_passwort = 'oger1302'; $db_name = 'DB1248927'; $dz = mysql_connect($db_server, $db_benutzer, $db_passwort); mysql_select_db($db_name); $testguid = "Select * from `IWH` where `ID`='$tag'"; $result = mysql_query($testguid); if ($ds = mysql_fetch_object($result)) { $status = $ds ->Status; } $client_id = "4e950e12c0464c158995b32ac82792d1"; $url = 'https://api.instagram.com/v1/tags/'.$tag.'/media/recent?client_id='.$client_id; $all_result = processURL($url); $decoded_results = json_decode($all_result, true); if(empty($decoded_results['data'])) { // Status = '1' setzen ggf. aktivieren if ($status =="0") { // update status = 1 $aendern = "UPDATE `IWH` SET `Status` = '1' WHERE `ID`='$tag'"; $update = mysql_query($aendern); if ($update) { $status="1"; } } echo '<img src="https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/e15/11351734_443374872513879_1446730755_n.jpg" style="width:100%;" border="0" alt="Null" />'; } else { // count = Count +1 hochsetzen $aendern = "UPDATE `IWH` Set `Count` = `Count`+ 1 WHERE `ID`='$tag'"; $update = mysql_query($aendern); if ($update) { $status="1"; } header('location: https://instagram.com/explore/tags/'.$tag.'/'); } mysql_close($dz); ?>
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/uFjvT:28 Stack trace: #0 {main} thrown in /in/uFjvT on line 28
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/uFjvT on line 28
Process exited with code 255.