3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( new stdClass(), new stdClass(), new stdClass(), ); $i = 0; foreach ($a as $o) { $o = (object) array( 'foo' => 'bar' . $i++, ); } var_dump($a);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/Whfo9
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $i, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~5      $3
    4     3        NEW                                              $6      'stdClass'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~5      $6
    5     6        NEW                                              $8      'stdClass'
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~5      $8
    2     9        ASSIGN                                                   !0, ~5
    7    10        ASSIGN                                                   !1, 0
    8    11      > FE_RESET_R                                       $12     !0, ->19
         12    > > FE_FETCH_R                                               $12, !2, ->19
   10    13    >   POST_INC                                         ~13     !1
         14        CONCAT                                           ~14     'bar', ~13
         15        INIT_ARRAY                                       ~15     ~14, 'foo'
         16        CAST                                          8  ~16     ~15
    9    17        ASSIGN                                                   !2, ~16
    8    18      > JMP                                                      ->12
         19    >   FE_FREE                                                  $12
   13    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.17 ms | 1395 KiB | 15 Q