3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json1 = '[{"one": "u0001u0000u0000u0000", "two": "u0002u0000u0000u0000", "three": "u0003u0000u0000u0000"}]'; $json2 = '[{ "a": { "one": "u0001u0000u0000u0000", "two": "u0002u0000u0000u0000", "three": "u0003u0000u0000u0000" } }]'; $arr1 = json_decode($json1,true); $arr2 = json_decode($json2,true); foreach($arr1 as $data){ $default1[] = implode($data); } $default1 = json_encode($default1, JSON_FORCE_OBJECT); foreach($arr2 as $key => $child){ foreach($child as $childKey => $data){ $default2[$childKey] = implode($data); } } $default2 = json_encode($default2, JSON_FORCE_OBJECT); print_r($default1); print_r($default2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 38
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 20
filename:       /in/mpSMM
function name:  (null)
number of ops:  53
compiled vars:  !0 = $json1, !1 = $json2, !2 = $arr1, !3 = $arr2, !4 = $data, !5 = $default1, !6 = $child, !7 = $key, !8 = $childKey, !9 = $default2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B%22one%22%3A+%22u0001u0000u0000u0000%22%2C+%22two%22%3A+%22u0002u0000u0000u0000%22%2C+%22three%22%3A+%22u0003u0000u0000u0000%22%7D%5D'
    4     1        ASSIGN                                                   !1, '%5B%7B+%22a%22%3A+%7B+%22one%22%3A+%22u0001u0000u0000u0000%22%2C+%22two%22%3A+%22u0002u0000u0000u0000%22%2C+%22three%22%3A+%22u0003u0000u0000u0000%22+%7D+%7D%5D'
    5     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $12     
          6        ASSIGN                                                   !2, $12
    6     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !3, $14
    9    12      > FE_RESET_R                                       $16     !2, ->20
         13    > > FE_FETCH_R                                               $16, !4, ->20
   10    14    >   INIT_FCALL                                               'implode'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $18     
         17        ASSIGN_DIM                                               !5
         18        OP_DATA                                                  $18
    9    19      > JMP                                                      ->13
         20    >   FE_FREE                                                  $16
   12    21        INIT_FCALL                                               'json_encode'
         22        SEND_VAR                                                 !5
         23        SEND_VAL                                                 16
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !5, $19
   14    26      > FE_RESET_R                                       $21     !3, ->40
         27    > > FE_FETCH_R                                       ~22     $21, !6, ->40
         28    >   ASSIGN                                                   !7, ~22
   15    29      > FE_RESET_R                                       $24     !6, ->38
         30    > > FE_FETCH_R                                       ~25     $24, !4, ->38
         31    >   ASSIGN                                                   !8, ~25
   16    32        INIT_FCALL                                               'implode'
         33        SEND_VAR                                                 !4
         34        DO_ICALL                                         $28     
         35        ASSIGN_DIM                                               !9, !8
         36        OP_DATA                                                  $28
   15    37      > JMP                                                      ->30
         38    >   FE_FREE                                                  $24
   14    39      > JMP                                                      ->27
         40    >   FE_FREE                                                  $21
   19    41        INIT_FCALL                                               'json_encode'
         42        SEND_VAR                                                 !9
         43        SEND_VAL                                                 16
         44        DO_ICALL                                         $29     
         45        ASSIGN                                                   !9, $29
   21    46        INIT_FCALL                                               'print_r'
         47        SEND_VAR                                                 !5
         48        DO_ICALL                                                 
   22    49        INIT_FCALL                                               'print_r'
         50        SEND_VAR                                                 !9
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.94 ms | 1400 KiB | 21 Q