3v4l.org

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

Class Foo:
Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/INQGf
function name:  f
number of ops:  11
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~2      
          1        CAST                                          7  ~3      ~2
          2      > FE_RESET_R                                       $4      ~3, ->9
          3    > > FE_FETCH_R                                       ~5      $4, !0, ->9
          4    >   ASSIGN                                                   !1, ~5
    9     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    8     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $4
   11    10      > RETURN                                                   null

End of function f

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.19 ms | 1396 KiB | 15 Q