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) { $b['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/n08mk
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 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/n08mk
function name:  test
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                      ~1      'bar'
          1      > FE_RESET_R                                       $2      ~1, ->6
          2    > > FE_FETCH_R                                               $2, !0, ->6
    6     3    >   ASSIGN_DIM                                               !0, 'a'
          4        OP_DATA                                                  'hello'
    5     5      > JMP                                                      ->2
          6    >   FE_FREE                                                  $2
    8     7      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.19 ms | 1399 KiB | 16 Q