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; } } (new A())->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n102Z
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'a'
   27     1        NEW                                              $0      'A'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Test:
Function implement:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n102Z
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/n102Z
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/n102Z
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.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.83 ms | 1394 KiB | 13 Q