3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MonsterTalk { protected $namespace = "MonsterTalk"; function __construct($userId, $domainKey, $salt) { $this->userId = $userId; $this->domainKey = $domainKey; $this->salt = $salt; $this->token; $this->authorize(); } function authorize() { if (!isset($_COOKIE["__dugalu_token"])){ $token = sha1($this->userId . "@" . $this->salt); $data = base64_encode('userId=' . $this->userId . "&domainKey=" . $this->domainKey . "&token=" . $token); echo $data; setcookie("__dugalu_auth", $data, time()+(60*60*24*30)); } else{ echo 'Existe el cookie'; } // $cookie = $this->genCookie(); } function genCookie() { $token = sha1($this->userId . "@" . $this->privateKey); return $this->$name; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/211H3
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E > > RETURN                                                   1

Class MonsterTalk:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/211H3
function name:  __construct
number of ops:  14
compiled vars:  !0 = $userId, !1 = $domainKey, !2 = $salt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN_OBJ                                               'userId'
          4        OP_DATA                                                  !0
   10     5        ASSIGN_OBJ                                               'domainKey'
          6        OP_DATA                                                  !1
   11     7        ASSIGN_OBJ                                               'salt'
          8        OP_DATA                                                  !2
   12     9        FETCH_OBJ_R                                      ~6      'token'
         10        FREE                                                     ~6
   14    11        INIT_METHOD_CALL                                         'authorize'
         12        DO_FCALL                                      0          
   15    13      > RETURN                                                   null

End of function __construct

Function authorize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 33
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/211H3
function name:  authorize
number of ops:  35
compiled vars:  !0 = $token, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_IS                                         ~2      '_COOKIE'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~2, '__dugalu_token'
          2        BOOL_NOT                                         ~4      ~3
          3      > JMPZ                                                     ~4, ->33
   21     4    >   INIT_FCALL                                               'sha1'
          5        FETCH_OBJ_R                                      ~5      'userId'
          6        CONCAT                                           ~6      ~5, '%40'
          7        FETCH_OBJ_R                                      ~7      'salt'
          8        CONCAT                                           ~8      ~6, ~7
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !0, $9
   22    12        INIT_FCALL                                               'base64_encode'
         13        FETCH_OBJ_R                                      ~11     'userId'
         14        CONCAT                                           ~12     'userId%3D', ~11
         15        CONCAT                                           ~13     ~12, '%26domainKey%3D'
         16        FETCH_OBJ_R                                      ~14     'domainKey'
         17        CONCAT                                           ~15     ~13, ~14
         18        CONCAT                                           ~16     ~15, '%26token%3D'
         19        CONCAT                                           ~17     ~16, !0
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                         $18     
         22        ASSIGN                                                   !1, $18
   23    23        ECHO                                                     !1
   24    24        INIT_FCALL                                               'setcookie'
         25        SEND_VAL                                                 '__dugalu_auth'
         26        SEND_VAR                                                 !1
         27        INIT_FCALL                                               'time'
         28        DO_ICALL                                         $20     
         29        ADD                                              ~21     $20, 2592000
         30        SEND_VAL                                                 ~21
         31        DO_ICALL                                                 
         32      > JMP                                                      ->34
   26    33    >   ECHO                                                     'Existe+el+cookie'
   29    34    > > RETURN                                                   null

End of function authorize

Function gencookie:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/211H3
function name:  genCookie
number of ops:  11
compiled vars:  !0 = $token, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'sha1'
          1        FETCH_OBJ_R                                      ~2      'userId'
          2        CONCAT                                           ~3      ~2, '%40'
          3        FETCH_OBJ_R                                      ~4      'privateKey'
          4        CONCAT                                           ~5      ~3, ~4
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !0, $6
   35     8        FETCH_OBJ_R                                      ~8      !1
          9      > RETURN                                                   ~8
   36    10*     > RETURN                                                   null

End of function gencookie

End of class MonsterTalk.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.77 ms | 1400 KiB | 21 Q