3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/plain'); $a = json_decode("[{\"id\":1, \"foo\":{\"123\": \"bar\"}}]"); $b = unserialize(serialize($a)); foreach($a[0]->foo as $name => $value) { $b[0]->foo->$name = "baz"; var_dump($b); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/QcANX
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $b, !2 = $value, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+text%2Fplain'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'json_decode'
          4        SEND_VAL                                                 '%5B%7B%22id%22%3A1%2C+%22foo%22%3A%7B%22123%22%3A+%22bar%22%7D%7D%5D'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    5     7        INIT_FCALL                                               'unserialize'
          8        INIT_FCALL                                               'serialize'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !1, $8
    7    14        FETCH_DIM_R                                      ~10     !0, 0
         15        FETCH_OBJ_R                                      ~11     ~10, 'foo'
         16      > FE_RESET_R                                       $12     ~11, ->27
         17    > > FE_FETCH_R                                       ~13     $12, !2, ->27
         18    >   ASSIGN                                                   !3, ~13
    8    19        FETCH_DIM_W                                      $15     !1, 0
         20        FETCH_OBJ_W                                      $16     $15, 'foo'
         21        ASSIGN_OBJ                                               $16, !3
         22        OP_DATA                                                  'baz'
    9    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
    7    26      > JMP                                                      ->17
         27    >   FE_FREE                                                  $12
   10    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.32 ms | 1396 KiB | 23 Q