3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait trt { protected $prop; } class inst { use trt; public function set($x) { $this->prop = $x; } public function get() { return $this->prop; } } $a = new inst(); $a->set("foo"); $b->set("bar"); echo $a->get(); echo "\n"; echo $b->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G1FUb
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'inst'
   16     1        NEW                                              $2      'inst'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   17     4        INIT_METHOD_CALL                                         !0, 'set'
          5        SEND_VAL_EX                                              'foo'
          6        DO_FCALL                                      0          
   18     7        INIT_METHOD_CALL                                         !1, 'set'
          8        SEND_VAL_EX                                              'bar'
          9        DO_FCALL                                      0          
   19    10        INIT_METHOD_CALL                                         !0, 'get'
         11        DO_FCALL                                      0  $7      
         12        ECHO                                                     $7
   20    13        ECHO                                                     '%0A'
   21    14        INIT_METHOD_CALL                                         !1, 'get'
         15        DO_FCALL                                      0  $8      
         16        ECHO                                                     $8
         17      > RETURN                                                   1

Class trt: [no user functions]
Class inst:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G1FUb
function name:  set
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'prop'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function set

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

End of function get

End of class inst.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.28 ms | 1395 KiB | 13 Q