3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $bars = []; } class bar { public $field; } $foo = new foo(); $bar = new bar(); $bar->field = 'hello'; $foo->bars[] = $bar; foreach ($foo->bars as $bar) { print_r($bar->field); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/RLapp
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   13     3        NEW                                              $5      'bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   14     6        ASSIGN_OBJ                                               !1, 'field'
          7        OP_DATA                                                  'hello'
   15     8        FETCH_OBJ_W                                      $9      !0, 'bars'
          9        ASSIGN_DIM                                               $9
         10        OP_DATA                                                  !1
   17    11        FETCH_OBJ_R                                      ~11     !0, 'bars'
         12      > FE_RESET_R                                       $12     ~11, ->19
         13    > > FE_FETCH_R                                               $12, !1, ->19
   18    14    >   INIT_FCALL                                               'print_r'
         15        FETCH_OBJ_R                                      ~13     !1, 'field'
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                                 
   17    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $12
   19    20      > RETURN                                                   1

Class foo: [no user functions]
Class bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1395 KiB | 15 Q