3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'foo' => 'bar', 'baz' => array( 'test' => 'bat', ), ); $string = json_encode($arr); echo $string, '<br/>'; $json = json_decode($string); $json->stuff->name = 'me'; $json->stuff->description = 'useless'; $newJsonString = json_encode($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J6sZd
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $string, !2 = $json, !3 = $newJsonString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    9     5        ECHO                                                     !1
          6        ECHO                                                     '%3Cbr%2F%3E'
   11     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   13    11        FETCH_OBJ_W                                      $9      !2, 'stuff'
         12        ASSIGN_OBJ                                               $9, 'name'
         13        OP_DATA                                                  'me'
   14    14        FETCH_OBJ_W                                      $11     !2, 'stuff'
         15        ASSIGN_OBJ                                               $11, 'description'
         16        OP_DATA                                                  'useless'
   15    17        INIT_FCALL                                               'json_encode'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.94 ms | 1395 KiB | 17 Q