3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Set API user and password define("API_USER","xxxxxxxxxx"); define("API_PASS","yyyyyyyyyy"); echo getSSOLink('tmp_5903a16748c8c_1493410151','8c896f52','RESET_SITE'); function getSSOLink($account,$siteName,$target) { $SSOAPIURL = 'https://api.dudamobile.com/api/accounts/sso/' . $account . '/link'; if($target) { $SSOAPIURL .= '?target=' . $target . '&site_name=' . $siteName; } $ch = curl_init(); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //format URL to grant access to email and sitename passed curl_setopt($ch, CURLOPT_URL, $SSOAPIURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, API_USER.':'.API_PASS); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); //execute cURL call $output = curl_exec($ch); //check result for correct HTTP code if(curl_getinfo($ch,CURLINFO_HTTP_CODE) == 200) { curl_close($ch); //decode JSON return $output = json_decode($output); //append 'asNew' URL param to change template select page messaging slightly return $output->url . '&asNew=true'; } else { curl_close($ch); die('Error getting SSO link: '. $output . '<br/>'); } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/d7oKF:16 Stack trace: #0 /in/d7oKF(6): getSSOLink('tmp_5903a16748c...', '8c896f52', 'RESET_SITE') #1 {main} thrown in /in/d7oKF on line 16
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:
52.28 ms | 401 KiB | 8 Q