3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestObject { public $stuff; } $obj = new TestObject(); $obj->stuff = array('1' => 'a', '2' => 'b', '3' => 'c'); print_r($obj->stuff); foreach ($obj->stuff as $k => $v) { echo "\n$k => $v; "; echo $obj->stuff[$k]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/LLonj
function name:  (null)
number of ops:  25
compiled vars:  !0 = $obj, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'TestObject'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    9     3        ASSIGN_OBJ                                               !0, 'stuff'
          4        OP_DATA                                                  <array>
   11     5        INIT_FCALL                                               'print_r'
          6        FETCH_OBJ_R                                      ~7      !0, 'stuff'
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                                 
   13     9        FETCH_OBJ_R                                      ~9      !0, 'stuff'
         10      > FE_RESET_R                                       $10     ~9, ->23
         11    > > FE_FETCH_R                                       ~11     $10, !1, ->23
         12    >   ASSIGN                                                   !2, ~11
   14    13        ROPE_INIT                                     5  ~14     '%0A'
         14        ROPE_ADD                                      1  ~14     ~14, !2
         15        ROPE_ADD                                      2  ~14     ~14, '+%3D%3E+'
         16        ROPE_ADD                                      3  ~14     ~14, !1
         17        ROPE_END                                      4  ~13     ~14, '%3B+'
         18        ECHO                                                     ~13
   15    19        FETCH_OBJ_R                                      ~17     !0, 'stuff'
         20        FETCH_DIM_R                                      ~18     ~17, !2
         21        ECHO                                                     ~18
   13    22      > JMP                                                      ->11
         23    >   FE_FREE                                                  $10
   16    24      > RETURN                                                   1

Class TestObject: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.88 ms | 1387 KiB | 15 Q