3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BaseClass { public static function getText() { return "base class"; } public function printWithSelf() { print self::getText(); } public function printWithStatic() { print static::getText(); } } class ExtendedClass extends BaseClass { public static function getText() { return "extended class"; } } $instance = new ExtendedClass(); $instance->printWithSelf(); print "\n"; $instance->printWithStatic();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UUFQF
function name:  (null)
number of ops:  9
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'ExtendedClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'printWithSelf'
          4        DO_FCALL                                      0          
   25     5        ECHO                                                     '%0A'
   26     6        INIT_METHOD_CALL                                         !0, 'printWithStatic'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class BaseClass:
Function gettext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UUFQF
function name:  getText
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'base+class'
    6     1*     > RETURN                                                   null

End of function gettext

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

End of function printwithself

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

End of function printwithstatic

End of class BaseClass.

Class ExtendedClass:
Function gettext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UUFQF
function name:  getText
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   'extended+class'
   20     1*     > RETURN                                                   null

End of function gettext

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

End of function printwithself

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

End of function printwithstatic

End of class ExtendedClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.86 ms | 1012 KiB | 13 Q