3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Human { const NAME = 'abstract'; public function getName() { return static::NAME; } } class John extends Human { const NAME = 'John'; } class Mark extends John { const NAME = 'Mark'; } $mark = new Mark(); $johh = new John(); echo $mark->getName(); echo "\n"; echo $john->getName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BLQZA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $mark, !1 = $johh, !2 = $john
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $3      'Mark'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   20     3        NEW                                              $6      'John'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   22     6        INIT_METHOD_CALL                                         !0, 'getName'
          7        DO_FCALL                                      0  $9      
          8        ECHO                                                     $9
   23     9        ECHO                                                     '%0A'
   24    10        INIT_METHOD_CALL                                         !2, 'getName'
         11        DO_FCALL                                      0  $10     
         12        ECHO                                                     $10
         13      > RETURN                                                   1

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

End of function getname

End of class Human.

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

End of function getname

End of class John.

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

End of function getname

End of class Mark.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.65 ms | 1395 KiB | 13 Q