3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = array('x' => array('a' => 'x1', 'b' => 'x2'), 'y' => array('a' => 'y1', 'b' => 'y2')); public function test() { foreach ($this->bar as $b => $c) { $this->bar['a'] = 'hello'; } } } $foo = new Foo(); $foo->test(); var_dump($foo->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bYJ8V
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   12     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~5      !0, 'bar'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Foo:
Function test:
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/bYJ8V
function name:  test
number of ops:  10
compiled vars:  !0 = $c, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                      ~2      'bar'
          1      > FE_RESET_R                                       $3      ~2, ->8
          2    > > FE_FETCH_R                                       ~4      $3, !0, ->8
          3    >   ASSIGN                                                   !1, ~4
    6     4        FETCH_OBJ_W                                      $6      'bar'
          5        ASSIGN_DIM                                               $6, 'a'
          6        OP_DATA                                                  'hello'
    5     7      > JMP                                                      ->2
          8    >   FE_FREE                                                  $3
    8     9      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.51 ms | 1395 KiB | 15 Q