3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test { protected $bridge; public function implement($name) { $this->bridge = $name; } } class A { use Test; public function __construct() { $this->implement('something'); } public function foo() { echo $this->bridge; } } class B extends A {}; var_dump(class_uses(new B()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JEmuW
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'a'
   27     1        DECLARE_CLASS                                            'b', 'a'
   29     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'class_uses'
          4        NEW                                              $0      'B'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Test:
Function implement:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JEmuW
function name:  implement
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'bridge'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function implement

End of class Test.

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

End of function __construct

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

End of function foo

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.8 ms | 1396 KiB | 17 Q