3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://suitecrm.atl.com.hk/crm-1/service/v4_1/rest.php"; $username = "magneticone"; $password = "magneticone"; //function to make cURL request function call($method, $parameters, $url) { ob_start(); $curl_request = curl_init(); curl_setopt($curl_request, CURLOPT_URL, $url); curl_setopt($curl_request, CURLOPT_POST, 1); curl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($curl_request, CURLOPT_HEADER, 1); curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0); $jsonEncodedData = json_encode($parameters); $post = array( "method" => $method, "input_type" => "JSON", "response_type" => "JSON", "rest_data" => $jsonEncodedData ); curl_setopt($curl_request, CURLOPT_POSTFIELDS, $post); $result = curl_exec($curl_request); curl_close($curl_request); $result = explode("\r\n\r\n", $result, 2); $response = json_decode($result[1]); ob_end_flush(); return $response; } //login ------------------------------ $login_parameters = array( "user_auth" => array( "user_name" => $username, "password" => md5($password), "version" => "1" ), "application_name" => "RestTest", "name_value_list" => array(), ); $login_result = call("login", $login_parameters, $url); echo "<pre>"; print_r($login_result); echo "</pre>"; //get session id $session_id = $login_result->id; ?>
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/hes2r:11 Stack trace: #0 /in/hes2r(52): call('login', Array, 'http://suitecrm...') #1 {main} thrown in /in/hes2r on line 11
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/hes2r:11 Stack trace: #0 /in/hes2r(52): call('login', Array, 'http://suitecrm...') #1 {main} thrown in /in/hes2r on line 11
Process exited with code 255.
Output for 5.6.0 - 5.6.26
Fatal error: Call to undefined function curl_init() in /in/hes2r on line 11
Process exited with code 255.

preferences:
167.7 ms | 401 KiB | 203 Q