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 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
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.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 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.

preferences:
170.39 ms | 402 KiB | 188 Q