3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.1.0
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 hhvm-3.10.0 - 3.12.0
start
Output for 5.1.2 - 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.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