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 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Gg5It
function name:  (null)
number of ops:  14
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
   20     4      > FE_RESET_R                                       $6      !0, ->12
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->12
          6    >   ASSIGN                                                   !2, ~7
   21     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   20    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $6
   22    13      > RETURN                                                   1

Class T:
Function t:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gg5It
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:
161.99 ms | 1401 KiB | 17 Q