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;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 53
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TdDYF
function name:  (null)
number of ops:  63
compiled vars:  !0 = $applicationName, !1 = $password, !2 = $key, !3 = $service_url, !4 = $curl, !5 = $curl_post_data, !6 = $curl_response, !7 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'testattsapp'
    3     1        ASSIGN                                                   !1, 'testattspass'
    4     2        ECHO                                                     'start'
    6     3        INIT_FCALL                                               'date_default_timezone_set'
          4        SEND_VAL                                                 'UTC'
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'hash'
          7        SEND_VAL                                                 'sha256'
          8        CONCAT                                           ~11     !1, '_'
          9        INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'Y-m-d'
         11        INIT_FCALL                                               'time'
         12        DO_ICALL                                         $12     
         13        SEND_VAR                                                 $12
         14        DO_ICALL                                         $13     
         15        CONCAT                                           ~14     ~11, $13
         16        SEND_VAL                                                 ~14
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !2, $15
   10    19        CONCAT                                           ~17     'http%3A%2F%2Fturn.anyfirewall.com%2Fephemeral-credential.php%3Fservice%3Dturn%26username%3D', !0
         20        CONCAT                                           ~18     ~17, '%26key%3D'
         21        CONCAT                                           ~19     ~18, !2
         22        ASSIGN                                                   !3, ~19
   11    23        INIT_FCALL_BY_NAME                                       'curl_init'
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0  $21     
         26        ASSIGN                                                   !4, $21
   12    27        ASSIGN                                                   !5, <array>
   13    28        INIT_FCALL_BY_NAME                                       'curl_setopt'
         29        SEND_VAR_EX                                              !4
         30        FETCH_CONSTANT                                   ~24     'CURLOPT_RETURNTRANSFER'
         31        SEND_VAL_EX                                              ~24
         32        SEND_VAL_EX                                              <true>
         33        DO_FCALL                                      0          
   14    34        INIT_FCALL_BY_NAME                                       'curl_setopt'
         35        SEND_VAR_EX                                              !4
         36        FETCH_CONSTANT                                   ~26     'CURLOPT_POST'
         37        SEND_VAL_EX                                              ~26
         38        SEND_VAL_EX                                              <true>
         39        DO_FCALL                                      0          
   15    40        INIT_FCALL_BY_NAME                                       'curl_setopt'
         41        SEND_VAR_EX                                              !4
         42        FETCH_CONSTANT                                   ~28     'CURLOPT_POSTFIELDS'
         43        SEND_VAL_EX                                              ~28
         44        SEND_VAR_EX                                              !5
         45        DO_FCALL                                      0          
   16    46        INIT_FCALL_BY_NAME                                       'curl_exec'
         47        SEND_VAR_EX                                              !4
         48        DO_FCALL                                      0  $30     
         49        ASSIGN                                                   !6, $30
   18    50        TYPE_CHECK                                    4          !6
         51      > JMPZ                                                     ~32, ->53
         52    > > RETURN                                                   null
   19    53    >   INIT_FCALL_BY_NAME                                       'curl_close'
         54        SEND_VAR_EX                                              !4
         55        DO_FCALL                                      0          
   20    56        INIT_FCALL                                               'json_decode'
         57        SEND_VAR                                                 !6
         58        DO_ICALL                                         $34     
         59        ASSIGN                                                   !7, $34
   21    60        ECHO                                                     !7
   22    61      > RETURN                                                   null
         62*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.5 ms | 1400 KiB | 23 Q