3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Father { protected $name = 'foo'; protected function getMember() { return $this->name; } } class Child extends Father { use OverrideMemberVisibility; } trait OverrideMemberVisibility{ abstract public function getMember(); } $child = new Child; echo $child->getMember();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgMBi
function name:  (null)
number of ops:  8
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'child', 'father'
   19     1        NEW                                              $1      'Child'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   21     4        INIT_METHOD_CALL                                         !0, 'getMember'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

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

End of function getmember

End of class Father.

Class Child: [no user functions]
Class OverrideMemberVisibility:
Function getmember:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgMBi
function name:  getMember
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function getmember

End of class OverrideMemberVisibility.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1385 KiB | 13 Q