3v4l.org

run code in 300+ PHP versions simultaneously
<?php class alpha { function classname(){ return __CLASS__; } function selfname(){ return self::classname(); } function staticname(){ return static::classname(); } } class beta extends alpha { function classname(){ return __CLASS__; } } $beta = new beta(); echo $beta->selfname(); echo $beta->staticname();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M2Dm3
function name:  (null)
number of ops:  10
compiled vars:  !0 = $beta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'beta'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'selfname'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   22     6        INIT_METHOD_CALL                                         !0, 'staticname'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

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

End of function classname

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

End of function selfname

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

End of function staticname

End of class alpha.

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

End of function classname

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

End of function selfname

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

End of function staticname

End of class beta.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.88 ms | 1399 KiB | 13 Q