3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a; protected $b; public $c; function f() { foreach ($this as $k=>$v) { var_dump($k); } } } $x = new Foo(); $x->f(); foreach ($x as $k=>$v) { var_dump($k); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/qhFZk
function name:  (null)
number of ops:  14
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      > FE_RESET_R                                       $7      !0, ->12
          6    > > FE_FETCH_R                                       ~8      $7, !1, ->12
          7    >   ASSIGN                                                   !2, ~8
   17     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   16    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $7
   18    13      > RETURN                                                   1

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

End of function f

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.74 ms | 1401 KiB | 15 Q