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/>'); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7oKF
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'API_USER'
          2        SEND_VAL                                                 'xxxxxxxxxx'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'API_PASS'
          6        SEND_VAL                                                 'yyyyyyyyyy'
          7        DO_ICALL                                                 
    6     8        INIT_FCALL_BY_NAME                                       'getSSOLink'
          9        SEND_VAL_EX                                              'tmp_5903a16748c8c_1493410151'
         10        SEND_VAL_EX                                              '8c896f52'
         11        SEND_VAL_EX                                              'RESET_SITE'
         12        DO_FCALL                                      0  $2      
         13        ECHO                                                     $2
   41    14      > RETURN                                                   1

Function getssolink:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 83
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 83
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
filename:       /in/d7oKF
function name:  getSSOLink
number of ops:  90
compiled vars:  !0 = $account, !1 = $siteName, !2 = $target, !3 = $SSOAPIURL, !4 = $ch, !5 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   10     3        CONCAT                                           ~6      'https%3A%2F%2Fapi.dudamobile.com%2Fapi%2Faccounts%2Fsso%2F', !0
          4        CONCAT                                           ~7      ~6, '%2Flink'
          5        ASSIGN                                                   !3, ~7
   12     6      > JMPZ                                                     !2, ->11
   13     7    >   CONCAT                                           ~9      '%3Ftarget%3D', !2
          8        CONCAT                                           ~10     ~9, '%26site_name%3D'
          9        CONCAT                                           ~11     ~10, !1
         10        ASSIGN_OP                                     8          !3, ~11
   16    11    >   INIT_FCALL_BY_NAME                                       'curl_init'
         12        DO_FCALL                                      0  $13     
         13        ASSIGN                                                   !4, $13
   17    14        INIT_FCALL_BY_NAME                                       'curl_setopt'
         15        SEND_VAR_EX                                              !4
         16        FETCH_CONSTANT                                   ~15     'CURLOPT_FOLLOWLOCATION'
         17        SEND_VAL_EX                                              ~15
         18        SEND_VAL_EX                                              <true>
         19        DO_FCALL                                      0          
   19    20        INIT_FCALL_BY_NAME                                       'curl_setopt'
         21        SEND_VAR_EX                                              !4
         22        FETCH_CONSTANT                                   ~17     'CURLOPT_URL'
         23        SEND_VAL_EX                                              ~17
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0          
   20    26        INIT_FCALL_BY_NAME                                       'curl_setopt'
         27        SEND_VAR_EX                                              !4
         28        FETCH_CONSTANT                                   ~19     'CURLOPT_RETURNTRANSFER'
         29        SEND_VAL_EX                                              ~19
         30        SEND_VAL_EX                                              <true>
         31        DO_FCALL                                      0          
   21    32        INIT_FCALL_BY_NAME                                       'curl_setopt'
         33        SEND_VAR_EX                                              !4
         34        FETCH_CONSTANT                                   ~21     'CURLOPT_USERPWD'
         35        SEND_VAL_EX                                              ~21
         36        FETCH_CONSTANT                                   ~22     'API_USER'
         37        CONCAT                                           ~23     ~22, '%3A'
         38        FETCH_CONSTANT                                   ~24     'API_PASS'
         39        CONCAT                                           ~25     ~23, ~24
         40        SEND_VAL_EX                                              ~25
         41        DO_FCALL                                      0          
   22    42        INIT_FCALL_BY_NAME                                       'curl_setopt'
         43        SEND_VAR_EX                                              !4
         44        FETCH_CONSTANT                                   ~27     'CURLOPT_HTTPAUTH'
         45        SEND_VAL_EX                                              ~27
         46        FETCH_CONSTANT                                   ~28     'CURLAUTH_BASIC'
         47        SEND_VAL_EX                                              ~28
         48        DO_FCALL                                      0          
   23    49        INIT_FCALL_BY_NAME                                       'curl_setopt'
         50        SEND_VAR_EX                                              !4
         51        FETCH_CONSTANT                                   ~30     'CURLOPT_HTTPHEADER'
         52        SEND_VAL_EX                                              ~30
         53        SEND_VAL_EX                                              <array>
         54        DO_FCALL                                      0          
   24    55        INIT_FCALL_BY_NAME                                       'curl_setopt'
         56        SEND_VAR_EX                                              !4
         57        FETCH_CONSTANT                                   ~32     'CURLOPT_CUSTOMREQUEST'
         58        SEND_VAL_EX                                              ~32
         59        SEND_VAL_EX                                              'GET'
         60        DO_FCALL                                      0          
   26    61        INIT_FCALL_BY_NAME                                       'curl_exec'
         62        SEND_VAR_EX                                              !4
         63        DO_FCALL                                      0  $34     
         64        ASSIGN                                                   !5, $34
   30    65        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         66        SEND_VAR_EX                                              !4
         67        FETCH_CONSTANT                                   ~36     'CURLINFO_HTTP_CODE'
         68        SEND_VAL_EX                                              ~36
         69        DO_FCALL                                      0  $37     
         70        IS_EQUAL                                                 $37, 200
         71      > JMPZ                                                     ~38, ->83
   31    72    >   INIT_FCALL_BY_NAME                                       'curl_close'
         73        SEND_VAR_EX                                              !4
         74        DO_FCALL                                      0          
   33    75        INIT_FCALL                                               'json_decode'
         76        SEND_VAR                                                 !5
         77        DO_ICALL                                         $40     
         78        ASSIGN                                                   !5, $40
   36    79        FETCH_OBJ_R                                      ~42     !5, 'url'
         80        CONCAT                                           ~43     ~42, '%26asNew%3Dtrue'
         81      > RETURN                                                   ~43
         82*       JMP                                                      ->89
   38    83    >   INIT_FCALL_BY_NAME                                       'curl_close'
         84        SEND_VAR_EX                                              !4
         85        DO_FCALL                                      0          
   39    86        CONCAT                                           ~45     'Error+getting+SSO+link%3A+', !5
         87        CONCAT                                           ~46     ~45, '%3Cbr%2F%3E'
         88      > EXIT                                                     ~46
   41    89*     > RETURN                                                   null

End of function getssolink

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.26 ms | 1404 KiB | 17 Q