3v4l.org

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

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

End of function foo

End of class T.

Class A:
Function getprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4PY51
function name:  getProp
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'prop'
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function getprop

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1393 KiB | 13 Q