3v4l.org

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

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

End of function foo

End of class foo.

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

End of function bar

End of class bar.

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

End of function __construct

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.45 ms | 1386 KiB | 13 Q