3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Repository { public function checkById() { return true; } } class A extends B { public function __construct(array $config) { // other stuff parent::__construct($config); // other stuff } public function check(int $id) { if ( $this->checkSomething($id) ) { return 'bla'; } } public function setLang(string $lang) { $this->repository->setLang($lang); } } class B { protected $repository; protected function __construct(array $config) { $this->repository = new Repository ($config); } protected function checkSomething(int $id) { if ( $this->repository->checkById($id) ) { return TRUE; } } public function get() { return 'whatever'; } } $config = ['some', 'config']; $a = new A($config); var_dump($a->get()); var_dump($a->check(1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  (null)
number of ops:  18
compiled vars:  !0 = $config, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'a', 'b'
   48     1        ASSIGN                                                   !0, <array>
   49     2        NEW                                              $3      'A'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $3
   50     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'get'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   51    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'check'
         13        SEND_VAL_EX                                              1
         14        DO_FCALL                                      0  $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class Repository:
Function checkbyid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  checkById
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   <true>
    7     1*     > RETURN                                                   null

End of function checkbyid

End of class Repository.

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  __construct
number of ops:  5
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   14     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   null

End of function __construct

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  check
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_METHOD_CALL                                         'checkSomething'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > JMPZ                                                     $1, ->6
   21     5    > > RETURN                                                   'bla'
   23     6    > > RETURN                                                   null

End of function check

Function setlang:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  setLang
number of ops:  6
compiled vars:  !0 = $lang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   26     1        FETCH_OBJ_R                                      ~1      'repository'
          2        INIT_METHOD_CALL                                         ~1, 'setLang'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   27     5      > RETURN                                                   null

End of function setlang

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  __construct
number of ops:  7
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        NEW                                              $2      'Repository'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'repository'
          5        OP_DATA                                                  $2
   35     6      > RETURN                                                   null

End of function __construct

Function checksomething:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  checkSomething
number of ops:  8
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   38     1        FETCH_OBJ_R                                      ~1      'repository'
          2        INIT_METHOD_CALL                                         ~1, 'checkById'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > JMPZ                                                     $2, ->7
   40     6    > > RETURN                                                   <true>
   42     7    > > RETURN                                                   null

End of function checksomething

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ql4NY
function name:  get
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E > > RETURN                                                   'whatever'
   46     1*     > RETURN                                                   null

End of function get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.51 ms | 1400 KiB | 15 Q