3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function thisCall() { return $this->call(); } public function selfCall() { return self::call(); } public function staticCall() { return static::call(); } public function call() { return 'A'; } } class AB extends A { public function call() { return 'AB'; } } class B extends AB { public function call() { return 'B'; } public function parentCall() { return parent::call(); } } $b = new B; var_dump([ 'this' => $b->thisCall(), 'self' => $b->selfCall(), 'static' => $b->staticCall(), 'b::parent' => $b->parentCall(), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  (null)
number of ops:  19
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   37     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   39     3        INIT_FCALL                                                   'var_dump'
   40     4        INIT_METHOD_CALL                                             !0, 'thisCall'
          5        DO_FCALL                                          0  $4      
          6        INIT_ARRAY                                           ~5      $4, 'this'
   41     7        INIT_METHOD_CALL                                             !0, 'selfCall'
          8        DO_FCALL                                          0  $6      
          9        ADD_ARRAY_ELEMENT                                    ~5      $6, 'self'
   42    10        INIT_METHOD_CALL                                             !0, 'staticCall'
         11        DO_FCALL                                          0  $7      
         12        ADD_ARRAY_ELEMENT                                    ~5      $7, 'static'
   43    13        INIT_METHOD_CALL                                             !0, 'parentCall'
         14        DO_FCALL                                          0  $8      
         15        ADD_ARRAY_ELEMENT                                    ~5      $8, 'b%3A%3Aparent'
         16        SEND_VAL                                                     ~5
   39    17        DO_ICALL                                                     
   44    18      > RETURN                                                       1

Class A:
Function thiscall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  thisCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                             'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
    6     3*     > RETURN                                                       null

End of function thiscall

Function selfcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  selfCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   10     3*     > RETURN                                                       null

End of function selfcall

Function staticcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  staticCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   14     3*     > RETURN                                                       null

End of function staticcall

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

End of function call

End of class A.

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

End of function call

Function thiscall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  thisCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                             'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
    6     3*     > RETURN                                                       null

End of function thiscall

Function selfcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  selfCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   10     3*     > RETURN                                                       null

End of function selfcall

Function staticcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  staticCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   14     3*     > RETURN                                                       null

End of function staticcall

End of class AB.

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

End of function call

Function parentcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  parentCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   34     3*     > RETURN                                                       null

End of function parentcall

Function thiscall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  thisCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                             'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
    6     3*     > RETURN                                                       null

End of function thiscall

Function selfcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  selfCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   10     3*     > RETURN                                                       null

End of function selfcall

Function staticcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJOTK
function name:  staticCall
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                      'call'
          1        DO_FCALL                                          0  $0      
          2      > RETURN                                                       $0
   14     3*     > RETURN                                                       null

End of function staticcall

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
182.37 ms | 3370 KiB | 14 Q