3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Wems; class Session { const AUTH_HTTPUSERS = 0; const AUTH_PAM = 1; public static function validate( $sessionId ) { return wemshttpauth_validateSession($sessionId); } public static function authenticate($username, $password, $method=self::AUTH_HTTPUSERS) { return wemshttpauth_verifyUser($username, $password); } public static function createSession($username, $userLevel, $ipAddress="N/A") { return wemshttpauth_createSession($username, $ipAddress, $userLevel); } public static function getRoleName($userLevel) { /* TODO: Needs implementing properly */ switch ($userLevel) { case 0: return 'View'; break; case 1: return 'User'; break; case 2: return 'Admin'; break; case 3: return 'Robot'; break; default: return 'Unknown'; break; } } public static function getPrivileges($username) { /* TODO: Implement Privileges correctly */ return array('all','test');; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QDosu
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E > > RETURN                                                   1

Class Wems\Session:
Function validate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QDosu
function name:  validate
number of ops:  6
compiled vars:  !0 = $sessionId
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_NS_FCALL_BY_NAME                                    'Wems%5Cwemshttpauth_validateSession'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   12     5*     > RETURN                                                   null

End of function validate

Function authenticate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QDosu
function name:  authenticate
number of ops:  9
compiled vars:  !0 = $username, !1 = $password, !2 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <const ast>
   15     3        INIT_NS_FCALL_BY_NAME                                    'Wems%5Cwemshttpauth_verifyUser'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
   16     8*     > RETURN                                                   null

End of function authenticate

Function createsession:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QDosu
function name:  createSession
number of ops:  10
compiled vars:  !0 = $username, !1 = $userLevel, !2 = $ipAddress
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      'N%2FA'
   19     3        INIT_NS_FCALL_BY_NAME                                    'Wems%5Cwemshttpauth_createSession'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !2
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   20     9*     > RETURN                                                   null

End of function createsession

Function getrolename:
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 187) Position 1 = 11, Position 2 = 13, Position 3 = 15, Position 4 = 17, Position 5 = 19, Position 6 = 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 17
Branch analysis from position: 15
Branch analysis from position: 13
Branch analysis from position: 11
filename:       /in/QDosu
function name:  getRoleName
number of ops:  22
compiled vars:  !0 = $userLevel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1      > SWITCH_LONG                                              !0, [ 0:->11, 1:->13, 2:->15, 3:->17, ], ->19
   25     2    >   IS_EQUAL                                                 !0, 0
          3      > JMPNZ                                                    ~1, ->11
   28     4    >   IS_EQUAL                                                 !0, 1
          5      > JMPNZ                                                    ~1, ->13
   31     6    >   IS_EQUAL                                                 !0, 2
          7      > JMPNZ                                                    ~1, ->15
   34     8    >   IS_EQUAL                                                 !0, 3
          9      > JMPNZ                                                    ~1, ->17
         10    > > JMP                                                      ->19
   26    11    > > RETURN                                                   'View'
   27    12*       JMP                                                      ->21
   29    13    > > RETURN                                                   'User'
   30    14*       JMP                                                      ->21
   32    15    > > RETURN                                                   'Admin'
   33    16*       JMP                                                      ->21
   35    17    > > RETURN                                                   'Robot'
   36    18*       JMP                                                      ->21
   38    19    > > RETURN                                                   'Unknown'
   39    20*       JMP                                                      ->21
   41    21*     > RETURN                                                   null

End of function getrolename

Function getprivileges:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QDosu
function name:  getPrivileges
number of ops:  3
compiled vars:  !0 = $username
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
   45     1      > RETURN                                                   <array>
   46     2*     > RETURN                                                   null

End of function getprivileges

End of class Wems\Session.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1403 KiB | 16 Q