3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("BF3APIIdent", 'R8tyRf7J5O'); define("BF3APIKey", 'UvVGtyTwb1BlT7nA2dzFT8fKIdUgeksg'); // Platform can be pc, 360, ps3 $platform = 'pc'; $memberObj = new \app\classes\Members(); $queryParam = array( 'WHERE' => "WHERE (usertype_tbusers<>'N')", 'ORDER' => 'ORDER BY lastupdate_tbusers ASC', 'LIMIT' => 'LIMIT ' . 20 ); $results = $memberObj->getAllbyCriteria($queryParam); $tempData = array('players' => array(), 'opt' => array()); foreach ($results as $newsEntry): $bf3Stats = updatePlayer($platform, $newsEntry->userid_tbusers); if ($bf3Stats['status'] == "exists"): $bf3Stats = lookupPlayer($platform, $newsEntry->userid_tbusers); if ($bf3Stats['status'] == "exists"): if ($bf3Stats['task'][result] == "found"): $tempData['players'][] = $newsEntry->userid_tbusers; endif; endif; endif; endforeach; $bf3Stats = getPlayersBF3Info($tempData); unset($bf3Stats['failed']); // to make sure that non finded players won´t get into it. $varPlayerPosition = 0; foreach ($bf3Stats['list'] as $userEntry): if (isset($userEntry)): $varKills = $userEntry['stats']['global']['kills']; $varDeaths = $userEntry['stats']['global']['deaths']; $varSkill = $userEntry['stats']['global']['elo']; $varlastUpdate = $userEntry['date_update']; $varRatio = round(($varKills / $varDeaths), 2); else: $varRatio = 0; $varSkill = 0; $varlastUpdate = time() - 86400; endif; $memberFound = $memberObj->getDataByID($tempData['players'][$varPlayerPosition]); if (count($memberFound) > 0): $tempAttributes = array( 'skill_tbusers' => $varSkill, 'ratio_tbusers' => $varRatio, 'lastupdate_tbusers' => date('Y-m-d H:i:s', $varlastUpdate) ); $memberFound->updateTo($tempAttributes); endif; $varPlayerPosition += 1; endforeach; //=========================== End of script ==================================================================== function setupClientKey($clientident = null, $name = null) { $data = array(); $data['ident'] = BF3APIIdent; $data['time'] = time(); $data['clientident'] = $clientident; $data['name'] = $name; return getAPIDataSigned('setupkey', 'global', $data); } function getClientKey($clientident) { $data = array(); $data['ident'] = BF3APIIdent; $data['time'] = time(); $data['clientident'] = $clientident; return getAPIDataSigned('getkey', 'global', $data); } function lookupPlayer($platform, $name) { echo BF3APIIdent; $data = array(); $data['ident'] = BF3APIIdent; $data['time'] = time(); $data['player'] = $name; return getAPIDataSigned('playerlookup', $platform, $data); } function updatePlayer($platform, $name) { $data = array(); $data['ident'] = BF3APIIdent; $data['time'] = time(); $data['player'] = $name; return getAPIDataSigned('playerupdate', $platform, $data); } function getAPIDataSigned($type, $platform, $data) { // Convert data to JSON $urlbase64 = array('+' => '-', '/' => '_', '=' => ''); $data = strtr(base64_encode(json_encode($data)), $urlbase64); $postdata = array(); $postdata['data'] = $data; $postdata['sig'] = strtr(base64_encode(hash_hmac('sha256', $data, BF3APIKey, true)), $urlbase64); // Run POST Request via CURL $c = curl_init('http://api.bf3stats.com/' . $platform . '/' . $type . '/'); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_USERAGENT, 'BF3StatsAPI/0.1'); curl_setopt($c, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_POSTFIELDS, $postdata); $data = curl_exec($c); $statuscode = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); if ($statuscode == 200) { // Decode JSON Data $data = json_decode($data, true); return $data; } else { echo "BF3 Stats API error status: " . $statuscode; return false; } } function getPlayersBF3Info($data) { // List of options $data['opt']['clear'] = true; $data['opt']['global'] = true; $data['time'] = time(); // Platform can be pc, 360, ps3 $platform = 'pc'; // Convert lists to JSON $postdata = array(); $postdata['players'] = json_encode($data['players']); $postdata['opt'] = json_encode($data['opt']); // Run POST Request via CURL $c = curl_init('http://api.bf3stats.com/' . $platform . '/playerlist/'); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_USERAGENT, 'BF3StatsAPI/0.1'); curl_setopt($c, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_POSTFIELDS, $postdata); $data = curl_exec($c); $statuscode = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); if ($statuscode == 200) { // Decode JSON Data $data = json_decode($data, true); // Print data for debugging return $data; // ... now you use $data to do whatever } else { return "ERROR"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 50
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 50
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 49
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 49
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 49
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 50
2 jumps found. (Code = 77) Position 1 = 59, Position 2 = 112
Branch analysis from position: 59
2 jumps found. (Code = 78) Position 1 = 60, Position 2 = 112
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 83
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 99, Position 2 = 110
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 110
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 99, Position 2 = 110
Branch analysis from position: 99
Branch analysis from position: 110
Branch analysis from position: 112
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 112
Branch analysis from position: 50
filename:       /in/k0fUr
function name:  (null)
number of ops:  114
compiled vars:  !0 = $platform, !1 = $memberObj, !2 = $queryParam, !3 = $results, !4 = $tempData, !5 = $newsEntry, !6 = $bf3Stats, !7 = $varPlayerPosition, !8 = $userEntry, !9 = $varKills, !10 = $varDeaths, !11 = $varSkill, !12 = $varlastUpdate, !13 = $varRatio, !14 = $memberFound, !15 = $tempAttributes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'BF3APIIdent'
          2        SEND_VAL                                                 'R8tyRf7J5O'
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'BF3APIKey'
          6        SEND_VAL                                                 'UvVGtyTwb1BlT7nA2dzFT8fKIdUgeksg'
          7        DO_ICALL                                                 
    6     8        ASSIGN                                                   !0, 'pc'
    8     9        NEW                                              $19     'app%5Cclasses%5CMembers'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $19
   10    12        ASSIGN                                                   !2, <array>
   16    13        INIT_METHOD_CALL                                         !1, 'getAllbyCriteria'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $23     
         16        ASSIGN                                                   !3, $23
   17    17        ASSIGN                                                   !4, <array>
   19    18      > FE_RESET_R                                       $26     !3, ->50
         19    > > FE_FETCH_R                                               $26, !5, ->50
   20    20    >   INIT_FCALL_BY_NAME                                       'updatePlayer'
         21        SEND_VAR_EX                                              !0
         22        CHECK_FUNC_ARG                                           
         23        FETCH_OBJ_FUNC_ARG                               $27     !5, 'userid_tbusers'
         24        SEND_FUNC_ARG                                            $27
         25        DO_FCALL                                      0  $28     
         26        ASSIGN                                                   !6, $28
   22    27        FETCH_DIM_R                                      ~30     !6, 'status'
         28        IS_EQUAL                                                 ~30, 'exists'
         29      > JMPZ                                                     ~31, ->49
   23    30    >   INIT_FCALL_BY_NAME                                       'lookupPlayer'
         31        SEND_VAR_EX                                              !0
         32        CHECK_FUNC_ARG                                           
         33        FETCH_OBJ_FUNC_ARG                               $32     !5, 'userid_tbusers'
         34        SEND_FUNC_ARG                                            $32
         35        DO_FCALL                                      0  $33     
         36        ASSIGN                                                   !6, $33
   24    37        FETCH_DIM_R                                      ~35     !6, 'status'
         38        IS_EQUAL                                                 ~35, 'exists'
         39      > JMPZ                                                     ~36, ->49
   25    40    >   FETCH_CONSTANT                                   ~38     'result'
         41        FETCH_DIM_R                                      ~37     !6, 'task'
         42        FETCH_DIM_R                                      ~39     ~37, ~38
         43        IS_EQUAL                                                 ~39, 'found'
         44      > JMPZ                                                     ~40, ->49
   26    45    >   FETCH_OBJ_R                                      ~43     !5, 'userid_tbusers'
         46        FETCH_DIM_W                                      $41     !4, 'players'
         47        ASSIGN_DIM                                               $41
         48        OP_DATA                                                  ~43
   19    49    > > JMP                                                      ->19
         50    >   FE_FREE                                                  $26
   32    51        INIT_FCALL_BY_NAME                                       'getPlayersBF3Info'
         52        SEND_VAR_EX                                              !4
         53        DO_FCALL                                      0  $44     
         54        ASSIGN                                                   !6, $44
   33    55        UNSET_DIM                                                !6, 'failed'
   35    56        ASSIGN                                                   !7, 0
   36    57        FETCH_DIM_R                                      ~47     !6, 'list'
         58      > FE_RESET_R                                       $48     ~47, ->112
         59    > > FE_FETCH_R                                               $48, !8, ->112
   37    60    >   ISSET_ISEMPTY_CV                                         !8
         61      > JMPZ                                                     ~49, ->83
   38    62    >   FETCH_DIM_R                                      ~50     !8, 'stats'
         63        FETCH_DIM_R                                      ~51     ~50, 'global'
         64        FETCH_DIM_R                                      ~52     ~51, 'kills'
         65        ASSIGN                                                   !9, ~52
   39    66        FETCH_DIM_R                                      ~54     !8, 'stats'
         67        FETCH_DIM_R                                      ~55     ~54, 'global'
         68        FETCH_DIM_R                                      ~56     ~55, 'deaths'
         69        ASSIGN                                                   !10, ~56
   40    70        FETCH_DIM_R                                      ~58     !8, 'stats'
         71        FETCH_DIM_R                                      ~59     ~58, 'global'
         72        FETCH_DIM_R                                      ~60     ~59, 'elo'
         73        ASSIGN                                                   !11, ~60
   41    74        FETCH_DIM_R                                      ~62     !8, 'date_update'
         75        ASSIGN                                                   !12, ~62
   43    76        INIT_FCALL                                               'round'
         77        DIV                                              ~64     !9, !10
         78        SEND_VAL                                                 ~64
         79        SEND_VAL                                                 2
         80        DO_ICALL                                         $65     
         81        ASSIGN                                                   !13, $65
         82      > JMP                                                      ->89
   45    83    >   ASSIGN                                                   !13, 0
   46    84        ASSIGN                                                   !11, 0
   47    85        INIT_FCALL                                               'time'
         86        DO_ICALL                                         $69     
         87        SUB                                              ~70     $69, 86400
         88        ASSIGN                                                   !12, ~70
   50    89    >   INIT_METHOD_CALL                                         !1, 'getDataByID'
         90        CHECK_FUNC_ARG                                           
         91        FETCH_DIM_FUNC_ARG                               $72     !4, 'players'
         92        FETCH_DIM_FUNC_ARG                               $73     $72, !7
         93        SEND_FUNC_ARG                                            $73
         94        DO_FCALL                                      0  $74     
         95        ASSIGN                                                   !14, $74
   52    96        COUNT                                            ~76     !14
         97        IS_SMALLER                                               0, ~76
         98      > JMPZ                                                     ~77, ->110
   54    99    >   INIT_ARRAY                                       ~78     !11, 'skill_tbusers'
   55   100        ADD_ARRAY_ELEMENT                                ~78     !13, 'ratio_tbusers'
   56   101        INIT_FCALL                                               'date'
        102        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
        103        SEND_VAR                                                 !12
        104        DO_ICALL                                         $79     
        105        ADD_ARRAY_ELEMENT                                ~78     $79, 'lastupdate_tbusers'
   53   106        ASSIGN                                                   !15, ~78
   58   107        INIT_METHOD_CALL                                         !14, 'updateTo'
        108        SEND_VAR_EX                                              !15
        109        DO_FCALL                                      0          
   60   110    >   ASSIGN_OP                                     1          !7, 1
   36   111      > JMP                                                      ->59
        112    >   FE_FREE                                                  $48
  168   113      > RETURN                                                   1

Function setupclientkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  setupClientKey
number of ops:  21
compiled vars:  !0 = $clientident, !1 = $name, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   65     2        ASSIGN                                                   !2, <array>
   66     3        FETCH_CONSTANT                                   ~5      'BF3APIIdent'
          4        ASSIGN_DIM                                               !2, 'ident'
          5        OP_DATA                                                  ~5
   67     6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $7      
          8        ASSIGN_DIM                                               !2, 'time'
          9        OP_DATA                                                  $7
   68    10        ASSIGN_DIM                                               !2, 'clientident'
         11        OP_DATA                                                  !0
   69    12        ASSIGN_DIM                                               !2, 'name'
         13        OP_DATA                                                  !1
   70    14        INIT_FCALL_BY_NAME                                       'getAPIDataSigned'
         15        SEND_VAL_EX                                              'setupkey'
         16        SEND_VAL_EX                                              'global'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $10     
         19      > RETURN                                                   $10
   71    20*     > RETURN                                                   null

End of function setupclientkey

Function getclientkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  getClientKey
number of ops:  18
compiled vars:  !0 = $clientident, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E >   RECV                                             !0      
   74     1        ASSIGN                                                   !1, <array>
   75     2        FETCH_CONSTANT                                   ~4      'BF3APIIdent'
          3        ASSIGN_DIM                                               !1, 'ident'
          4        OP_DATA                                                  ~4
   76     5        INIT_FCALL                                               'time'
          6        DO_ICALL                                         $6      
          7        ASSIGN_DIM                                               !1, 'time'
          8        OP_DATA                                                  $6
   77     9        ASSIGN_DIM                                               !1, 'clientident'
         10        OP_DATA                                                  !0
   78    11        INIT_FCALL_BY_NAME                                       'getAPIDataSigned'
         12        SEND_VAL_EX                                              'getkey'
         13        SEND_VAL_EX                                              'global'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16      > RETURN                                                   $8
   79    17*     > RETURN                                                   null

End of function getclientkey

Function lookupplayer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  lookupPlayer
number of ops:  21
compiled vars:  !0 = $platform, !1 = $name, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   81     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   82     2        FETCH_CONSTANT                                   ~3      'BF3APIIdent'
          3        ECHO                                                     ~3
   83     4        ASSIGN                                                   !2, <array>
   84     5        FETCH_CONSTANT                                   ~6      'BF3APIIdent'
          6        ASSIGN_DIM                                               !2, 'ident'
          7        OP_DATA                                                  ~6
   85     8        INIT_FCALL                                               'time'
          9        DO_ICALL                                         $8      
         10        ASSIGN_DIM                                               !2, 'time'
         11        OP_DATA                                                  $8
   86    12        ASSIGN_DIM                                               !2, 'player'
         13        OP_DATA                                                  !1
   87    14        INIT_FCALL_BY_NAME                                       'getAPIDataSigned'
         15        SEND_VAL_EX                                              'playerlookup'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $10     
         19      > RETURN                                                   $10
   88    20*     > RETURN                                                   null

End of function lookupplayer

Function updateplayer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  updatePlayer
number of ops:  19
compiled vars:  !0 = $platform, !1 = $name, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   90     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   92     2        ASSIGN                                                   !2, <array>
   93     3        FETCH_CONSTANT                                   ~5      'BF3APIIdent'
          4        ASSIGN_DIM                                               !2, 'ident'
          5        OP_DATA                                                  ~5
   94     6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $7      
          8        ASSIGN_DIM                                               !2, 'time'
          9        OP_DATA                                                  $7
   95    10        ASSIGN_DIM                                               !2, 'player'
         11        OP_DATA                                                  !1
   96    12        INIT_FCALL_BY_NAME                                       'getAPIDataSigned'
         13        SEND_VAL_EX                                              'playerupdate'
         14        SEND_VAR_EX                                              !0
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0  $9      
         17      > RETURN                                                   $9
   97    18*     > RETURN                                                   null

End of function updateplayer

Function getapidatasigned:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 100
Branch analysis from position: 93
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  getAPIDataSigned
number of ops:  104
compiled vars:  !0 = $type, !1 = $platform, !2 = $data, !3 = $urlbase64, !4 = $postdata, !5 = $c, !6 = $statuscode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  101     3        ASSIGN                                                   !3, <array>
  102     4        INIT_FCALL                                               'strtr'
          5        INIT_FCALL                                               'base64_encode'
          6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $8      
          9        SEND_VAR                                                 $8
         10        DO_ICALL                                         $9      
         11        SEND_VAR                                                 $9
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !2, $10
  104    15        ASSIGN                                                   !4, <array>
  105    16        ASSIGN_DIM                                               !4, 'data'
         17        OP_DATA                                                  !2
  106    18        INIT_FCALL                                               'strtr'
         19        INIT_FCALL                                               'base64_encode'
         20        INIT_FCALL                                               'hash_hmac'
         21        SEND_VAL                                                 'sha256'
         22        SEND_VAR                                                 !2
         23        FETCH_CONSTANT                                   ~15     'BF3APIKey'
         24        SEND_VAL                                                 ~15
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $16     
         27        SEND_VAR                                                 $16
         28        DO_ICALL                                         $17     
         29        SEND_VAR                                                 $17
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $18     
         32        ASSIGN_DIM                                               !4, 'sig'
         33        OP_DATA                                                  $18
  109    34        INIT_FCALL_BY_NAME                                       'curl_init'
         35        CONCAT                                           ~19     'http%3A%2F%2Fapi.bf3stats.com%2F', !1
         36        CONCAT                                           ~20     ~19, '%2F'
         37        CONCAT                                           ~21     ~20, !0
         38        CONCAT                                           ~22     ~21, '%2F'
         39        SEND_VAL_EX                                              ~22
         40        DO_FCALL                                      0  $23     
         41        ASSIGN                                                   !5, $23
  110    42        INIT_FCALL_BY_NAME                                       'curl_setopt'
         43        SEND_VAR_EX                                              !5
         44        FETCH_CONSTANT                                   ~25     'CURLOPT_HEADER'
         45        SEND_VAL_EX                                              ~25
         46        SEND_VAL_EX                                              <false>
         47        DO_FCALL                                      0          
  111    48        INIT_FCALL_BY_NAME                                       'curl_setopt'
         49        SEND_VAR_EX                                              !5
         50        FETCH_CONSTANT                                   ~27     'CURLOPT_POST'
         51        SEND_VAL_EX                                              ~27
         52        SEND_VAL_EX                                              <true>
         53        DO_FCALL                                      0          
  112    54        INIT_FCALL_BY_NAME                                       'curl_setopt'
         55        SEND_VAR_EX                                              !5
         56        FETCH_CONSTANT                                   ~29     'CURLOPT_USERAGENT'
         57        SEND_VAL_EX                                              ~29
         58        SEND_VAL_EX                                              'BF3StatsAPI%2F0.1'
         59        DO_FCALL                                      0          
  113    60        INIT_FCALL_BY_NAME                                       'curl_setopt'
         61        SEND_VAR_EX                                              !5
         62        FETCH_CONSTANT                                   ~31     'CURLOPT_HTTPHEADER'
         63        SEND_VAL_EX                                              ~31
         64        SEND_VAL_EX                                              <array>
         65        DO_FCALL                                      0          
  114    66        INIT_FCALL_BY_NAME                                       'curl_setopt'
         67        SEND_VAR_EX                                              !5
         68        FETCH_CONSTANT                                   ~33     'CURLOPT_RETURNTRANSFER'
         69        SEND_VAL_EX                                              ~33
         70        SEND_VAL_EX                                              <true>
         71        DO_FCALL                                      0          
  115    72        INIT_FCALL_BY_NAME                                       'curl_setopt'
         73        SEND_VAR_EX                                              !5
         74        FETCH_CONSTANT                                   ~35     'CURLOPT_POSTFIELDS'
         75        SEND_VAL_EX                                              ~35
         76        SEND_VAR_EX                                              !4
         77        DO_FCALL                                      0          
  116    78        INIT_FCALL_BY_NAME                                       'curl_exec'
         79        SEND_VAR_EX                                              !5
         80        DO_FCALL                                      0  $37     
         81        ASSIGN                                                   !2, $37
  117    82        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         83        SEND_VAR_EX                                              !5
         84        FETCH_CONSTANT                                   ~39     'CURLINFO_HTTP_CODE'
         85        SEND_VAL_EX                                              ~39
         86        DO_FCALL                                      0  $40     
         87        ASSIGN                                                   !6, $40
  118    88        INIT_FCALL_BY_NAME                                       'curl_close'
         89        SEND_VAR_EX                                              !5
         90        DO_FCALL                                      0          
  120    91        IS_EQUAL                                                 !6, 200
         92      > JMPZ                                                     ~43, ->100
  122    93    >   INIT_FCALL                                               'json_decode'
         94        SEND_VAR                                                 !2
         95        SEND_VAL                                                 <true>
         96        DO_ICALL                                         $44     
         97        ASSIGN                                                   !2, $44
  123    98      > RETURN                                                   !2
         99*       JMP                                                      ->103
  125   100    >   CONCAT                                           ~46     'BF3+Stats+API+error+status%3A+', !6
        101        ECHO                                                     ~46
  126   102      > RETURN                                                   <false>
  128   103*     > RETURN                                                   null

End of function getapidatasigned

Function getplayersbf3info:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 89
Branch analysis from position: 82
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0fUr
function name:  getPlayersBF3Info
number of ops:  91
compiled vars:  !0 = $data, !1 = $platform, !2 = $postdata, !3 = $c, !4 = $statuscode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  130     0  E >   RECV                                             !0      
  132     1        FETCH_DIM_W                                      $5      !0, 'opt'
          2        ASSIGN_DIM                                               $5, 'clear'
          3        OP_DATA                                                  <true>
  133     4        FETCH_DIM_W                                      $7      !0, 'opt'
          5        ASSIGN_DIM                                               $7, 'global'
          6        OP_DATA                                                  <true>
  134     7        INIT_FCALL                                               'time'
          8        DO_ICALL                                         $10     
          9        ASSIGN_DIM                                               !0, 'time'
         10        OP_DATA                                                  $10
  137    11        ASSIGN                                                   !1, 'pc'
  140    12        ASSIGN                                                   !2, <array>
  141    13        INIT_FCALL                                               'json_encode'
         14        FETCH_DIM_R                                      ~14     !0, 'players'
         15        SEND_VAL                                                 ~14
         16        DO_ICALL                                         $15     
         17        ASSIGN_DIM                                               !2, 'players'
         18        OP_DATA                                                  $15
  142    19        INIT_FCALL                                               'json_encode'
         20        FETCH_DIM_R                                      ~17     !0, 'opt'
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                         $18     
         23        ASSIGN_DIM                                               !2, 'opt'
         24        OP_DATA                                                  $18
  146    25        INIT_FCALL_BY_NAME                                       'curl_init'
         26        CONCAT                                           ~19     'http%3A%2F%2Fapi.bf3stats.com%2F', !1
         27        CONCAT                                           ~20     ~19, '%2Fplayerlist%2F'
         28        SEND_VAL_EX                                            

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.75 ms | 1420 KiB | 31 Q