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 $k => $v) { var_dump($k, $v); } $a = (array)$a; foreach ($a as $k => $v) { var_dump($k, $v); }
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
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 14
filename:       /in/sSdU0
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $v, !2 = $k
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
   24    15        CAST                                          7  ~11     !0
         16        ASSIGN                                                   !0, ~11
   25    17      > FE_RESET_R                                       $13     !0, ->25
         18    > > FE_FETCH_R                                       ~14     $13, !1, ->25
         19    >   ASSIGN                                                   !2, ~14
   26    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   25    24      > JMP                                                      ->18
         25    >   FE_FREE                                                  $13
   27    26      > RETURN                                                   1

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