3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class a { abstract protected static function getClass(); public function concreteMethod() { return static::getClass(); } } class b extends a { protected static function getClass() { return __CLASS__; } } class c extends a { protected static function getClass() { return __CLASS__; } } $b = new b(); echo $b->concreteMethod()."\n"; $c = new c(); echo $c->concreteMethod()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5YFJb
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   30     3        INIT_METHOD_CALL                                         !0, 'concreteMethod'
          4        DO_FCALL                                      0  $5      
          5        CONCAT                                           ~6      $5, '%0A'
          6        ECHO                                                     ~6
   31     7        NEW                                              $7      'c'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   32    10        INIT_METHOD_CALL                                         !1, 'concreteMethod'
         11        DO_FCALL                                      0  $10     
         12        CONCAT                                           ~11     $10, '%0A'
         13        ECHO                                                     ~11
         14      > RETURN                                                   1

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

End of function getclass

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

End of function concretemethod

End of class a.

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

End of function getclass

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

End of function concretemethod

End of class b.

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

End of function getclass

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

End of function concretemethod

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.01 ms | 944 KiB | 14 Q