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, true); $json['stuff']['name'] ='me'; $newJsonString = json_encode($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11mcL
function name:  (null)
number of ops:  20
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        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   12    12        FETCH_DIM_W                                      $9      !2, 'stuff'
         13        ASSIGN_DIM                                               $9, 'name'
         14        OP_DATA                                                  'me'
   14    15        INIT_FCALL                                               'json_encode'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !3, $11
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.21 ms | 1395 KiB | 17 Q