3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP // ini_set('max_execution_time', 6000); // flush(); // ob_flush(); // ------------------------- DB SETUP ------------------ $dbhost = 'faradaypromo.com:3306'; $dbuser = 'priceles_kst'; $dbpass = 'kst33'; $dbname = 'priceles_kst'; $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname); if ($conn->connect_error) { trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR); } // ------------------------- READ LIST ------------------- $wlist = "http://faradaypromo.com/aggr_dom2.txt"; $handle = fopen($wlist, "r"); if ($handle) { while (($line = fgets($handle)) !== false) { pinger($line); } } else { // error opening the file. echo "file io error"; } fclose($handle); // ----------------------------FUNCTIONS ------------------- function pinger($ws){ $ch = curl_init(); $options = array( CURLOPT_URL => $ws, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 1, CURLOPT_TIMEOUT_MS => 500, CURLOPT_MAXREDIRS => 10, CURLOPT_NOSIGNAL => 1 ); curl_setopt_array( $ch, $options ); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); echo date('H:i:s')." - ".$ws." ".$httpCode."/n"; if ( $httpCode == 200 ){ write_sql($ws, $httpCode); } curl_close($ch); } function write_sql($ws, $code){ $sql = "INSERT INTO websites (cat,uri,status, time) VALUES ('$wlist','$ws',$code,NOW())"; if($conn->query($sql) === false) { trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR); } else { $last_inserted_id = $conn->insert_id; $affected_rows = $conn->affected_rows; echo " - ok: id ".$last_inserted_id; } } mysql_close($conn);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "mysqli" not found in /in/vjYdl:11 Stack trace: #0 {main} thrown in /in/vjYdl on line 11
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.79 ms | 401 KiB | 8 Q