3v4l.org

run code in 300+ PHP versions simultaneously
<?php $object = new stdClass(); $object->foo = 'abc'; $object->bar = 'def'; $list = $object; $field = 'test'; foreach( $list as $key => $value ) { if ( is_object( $value ) ) { $list[ $key ] = $value->$field; } else { $list[ $key ] = $value[ $field ]; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/9YsaD
function name:  (null)
number of ops:  24
compiled vars:  !0 = $object, !1 = $list, !2 = $field, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    4     3        ASSIGN_OBJ                                               !0, 'foo'
          4        OP_DATA                                                  'abc'
    5     5        ASSIGN_OBJ                                               !0, 'bar'
          6        OP_DATA                                                  'def'
    7     7        ASSIGN                                                   !1, !0
    8     8        ASSIGN                                                   !2, 'test'
   10     9      > FE_RESET_R                                       $12     !1, ->22
         10    > > FE_FETCH_R                                       ~13     $12, !3, ->22
         11    >   ASSIGN                                                   !4, ~13
   11    12        TYPE_CHECK                                  256          !3
         13      > JMPZ                                                     ~15, ->18
   12    14    >   FETCH_OBJ_R                                      ~17     !3, !2
         15        ASSIGN_DIM                                               !1, !4
         16        OP_DATA                                                  ~17
   11    17      > JMP                                                      ->21
   14    18    >   FETCH_DIM_R                                      ~19     !3, !2
         19        ASSIGN_DIM                                               !1, !4
         20        OP_DATA                                                  ~19
   10    21    > > JMP                                                      ->10
         22    >   FE_FREE                                                  $12
   16    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.35 ms | 1430 KiB | 13 Q