3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { private $a = 1; public function t() { var_dump($this->a); var_dump(get_object_vars($this)); } } class A { use T; } $a = new A(); $a->t(); foreach ($a as $key => $field) { var_dump($key, $field); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/Kj99H
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $field, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'a'
   17     1        NEW                                              $3      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   18     4        INIT_METHOD_CALL                                         !0, 't'
          5        DO_FCALL                                      0          
   20     6      > FE_RESET_R                                       $7      !0, ->14
          7    > > FE_FETCH_R                                       ~8      $7, !1, ->14
          8    >   ASSIGN                                                   !2, ~8
   21     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   20    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $7
   22    15      > RETURN                                                   1

Class T:
Function t:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kj99H
function name:  t
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'a'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'get_object_vars'
          6        FETCH_THIS                                       ~2      
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
    9    11      > RETURN                                                   null

End of function t

End of class T.

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.55 ms | 1396 KiB | 17 Q