3v4l.org

run code in 300+ PHP versions simultaneously
<?php $applicationName = "testattsapp"; $password = "testattspass"; echo "start"; date_default_timezone_set("UTC"); //Create the key using password + “_” + current UTC year + “-” + current UTC month + “-” + current UTC day then encrypt the key using SHA256 $key = hash ( "sha256" ,$password . "_" . date("Y-m-d", time())); //POST request with parameters for service, username and key, in order to get the ephemeral credential $service_url = "http://turn.anyfirewall.com/ephemeral-credential.php?service=turn&username=".$applicationName."&key=".$key; $curl = curl_init($service_url); $curl_post_data = array(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); //If no response from server, return to here. if ($curl_response === false) return NULL; curl_close($curl); $response = json_decode($curl_response); echo $response; return NULL;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
start Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/TdDYF:11 Stack trace: #0 {main} thrown in /in/TdDYF on line 11
Process exited with code 255.
Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
start Fatal error: Call to undefined function curl_init() in /in/TdDYF on line 11
Process exited with code 255.
Output for 5.1.0 - 5.1.1
start Fatal error: Call to undefined function hash() in /in/TdDYF on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
start Fatal error: Call to undefined function date_default_timezone_set() in /in/TdDYF on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
start Fatal error: Call to undefined function: date_default_timezone_set() in /in/TdDYF on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
start Fatal error: Call to undefined function: date_default_timezone_set() in /in/TdDYF on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
start Fatal error: Call to undefined function: date_default_timezone_set() in /in/TdDYF on line 6

preferences:
141.93 ms | 401 KiB | 233 Q