3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dad { function dad() { // implements some logic } } class child extends dad { function child() { echo "I'm " , get_parent_class($this) , "'s son\n"; parrent::child(); } } class child2 extends dad { function child2() { echo "I'm " , get_parent_class('child2') , "'s son too\n"; } } $foo = new child(); $foo->child(); $bar = new child2(); $bar->child2(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rE7bn
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        INIT_METHOD_CALL                                         !0, 'child'
          4        DO_FCALL                                      0          
   27     5        NEW                                              $6      'child2'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   28     8        INIT_METHOD_CALL                                         !1, 'child2'
          9        DO_FCALL                                      0          
   29    10      > RETURN                                                   1

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

End of function dad

End of class dad.

Class child:
Function child:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rE7bn
function name:  child
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'I%27m+'
          1        INIT_FCALL                                               'get_parent_class'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        ECHO                                                     $1
          6        ECHO                                                     '%27s+son%0A'
   14     7        INIT_STATIC_METHOD_CALL                                  'parrent', 'child'
          8        DO_FCALL                                      0          
   15     9      > RETURN                                                   null

End of function child

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

End of function dad

End of class child.

Class child2:
Function child2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rE7bn
function name:  child2
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'I%27m+'
          1        INIT_FCALL                                               'get_parent_class'
          2        SEND_VAL                                                 'child2'
          3        DO_ICALL                                         $0      
          4        ECHO                                                     $0
          5        ECHO                                                     '%27s+son+too%0A'
   22     6      > RETURN                                                   null

End of function child2

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

End of function dad

End of class child2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.84 ms | 1392 KiB | 15 Q