3v4l.org

run code in 300+ PHP versions simultaneously
<html><head><title>Online PHP Script Execution</title></head><body><?php/*Template Name: Update events template*/?><?phptry{ $client = new SoapClient("http://www.ernact.eu/webservices/Events.asmx?wsdl");} catch (Exception $e) { echo "<h2>Exception Error!</h2>"; echo $e->getMessage(); } $result = $client->GetEvents(array('ProjectID' => '81'));$icsOut = "BEGIN:VCALENDARPRODID:-//bobbin v0.1//NONSGML iCal Writer//ENVERSION:2.0CALSCALE:GREGORIANMETHOD:PUBLISH";$dateStart = new DateTime('2000-01-01');$dateStart->format('Y-m-d');foreach($result->GetEventsResult->ErnactEvent as $item){$icsOut .= "BEGIN:VEVENTDTSTART:".date('Ymd', strtotime(str_replace('/','-',$item->StartDate)))."T".date('His', strtotime($item->StartTime))."ZDTEND:".date('Ymd', strtotime(str_replace('/','-',$item->FinishDate)))."T".date('His', strtotime($item->FinishTime))."ZDTSTAMP:" . date('Ymd').'T'. gmdate('His') . "ZUID:" . md5(uniqid(mt_rand(), true)) . "@create-nwe.euDESCRIPTION:".$item->Description."SUMMARY:".$item->Title."LOCATION:".$item->Location."CONTACT:".$item->ContactName."END:VEVENT";// Create post object/*$create_event_content = $item->Description . '<br><br><a href="'.$item->Link.'" title="View more details about '.$item->Title.'" target="_blank">'.$item->Link.'</a>';$my_post = array( 'post_title' => $item->Title, 'post_content' => $create_event_content, 'post_type' => 'events', 'post_status' => 'publish', 'post_author' => 1);print_r($my_post);// Insert the post into the database$create_event_post_id = wp_insert_post( $my_post );update_post_meta( $create_event_post_id, 'date', date('m/d/Y', strtotime($item->StartDate)) );*/}$icsOut .= "END:VCALENDAR";echo $icsOut;?></body></html>
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.32, 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.32, 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
<html><head><title>Online PHP Script Execution</title></head><body><?php/*Template Name: Update events template*/?><?phptry{ $client = new SoapClient("http://www.ernact.eu/webservices/Events.asmx?wsdl");} catch (Exception $e) { echo "<h2>Exception Error!</h2>"; echo $e->getMessage(); } $result = $client->GetEvents(array('ProjectID' => '81'));$icsOut = "BEGIN:VCALENDARPRODID:-//bobbin v0.1//NONSGML iCal Writer//ENVERSION:2.0CALSCALE:GREGORIANMETHOD:PUBLISH";$dateStart = new DateTime('2000-01-01');$dateStart->format('Y-m-d');foreach($result->GetEventsResult->ErnactEvent as $item){$icsOut .= "BEGIN:VEVENTDTSTART:".date('Ymd', strtotime(str_replace('/','-',$item->StartDate)))."T".date('His', strtotime($item->StartTime))."ZDTEND:".date('Ymd', strtotime(str_replace('/','-',$item->FinishDate)))."T".date('His', strtotime($item->FinishTime))."ZDTSTAMP:" . date('Ymd').'T'. gmdate('His') . "ZUID:" . md5(uniqid(mt_rand(), true)) . "@create-nwe.euDESCRIPTION:".$item->Description."SUMMARY:".$item->Title."LOCATION:".$item->Location."CONTACT:".$item->ContactName."END:VEVENT";// Create post object/*$create_event_content = $item->Description . '<br><br><a href="'.$item->Link.'" title="View more details about '.$item->Title.'" target="_blank">'.$item->Link.'</a>';$my_post = array( 'post_title' => $item->Title, 'post_content' => $create_event_content, 'post_type' => 'events', 'post_status' => 'publish', 'post_author' => 1);print_r($my_post);// Insert the post into the database$create_event_post_id = wp_insert_post( $my_post );update_post_meta( $create_event_post_id, 'date', date('m/d/Y', strtotime($item->StartDate)) );*/}$icsOut .= "END:VCALENDAR";echo $icsOut;?></body></html>
Output for 8.0.13
Parse error: syntax error, unexpected token ";" in /in/gTCmJ on line 1
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Parse error: syntax error, unexpected '{' in /in/gTCmJ on line 1
Process exited with code 255.

preferences:
181.06 ms | 401 KiB | 255 Q