3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Authenticator { protected $isloggedin; protected $session; public function __construct(BasicSession $session) { $this->session = $session; if ($session->get('isloggedin')) { $this->isloggedin = true; } } } class BasicSession { protected $session = array(); public function get($key) { if (isset($this->session[$key])) { return $this->session[$key]; } return false; } } $auth = new Authenticator(new BasicSession());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RbiQ7
function name:  (null)
number of ops:  7
compiled vars:  !0 = $auth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Authenticator'
          1        NEW                                              $2      'BasicSession'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
          6      > RETURN                                                   1

Class Authenticator:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/RbiQ7
function name:  __construct
number of ops:  10
compiled vars:  !0 = $session
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'session'
          2        OP_DATA                                                  !0
   10     3        INIT_METHOD_CALL                                         !0, 'get'
          4        SEND_VAL_EX                                              'isloggedin'
          5        DO_FCALL                                      0  $2      
          6      > JMPZ                                                     $2, ->9
   11     7    >   ASSIGN_OBJ                                               'isloggedin'
          8        OP_DATA                                                  <true>
   13     9    > > RETURN                                                   null

End of function __construct

End of class Authenticator.

Class BasicSession:
Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RbiQ7
function name:  get
number of ops:  9
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_IS                                     ~1      'session'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->7
   21     4    >   FETCH_OBJ_R                                      ~3      'session'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6      > RETURN                                                   ~4
   23     7    > > RETURN                                                   <false>
   24     8*     > RETURN                                                   null

End of function get

End of class BasicSession.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.84 ms | 1395 KiB | 13 Q