3v4l.org

run code in 300+ PHP versions simultaneously
<?php $formData = []; $results['staging_records'][0] = [ 'import_id' => 185, 'customer_id' => 106, 'form_data' =>'[{"0":"2017-11-03 12:40:47","1":327,"2":"BR","3":"106","4":"117399795","5":"A","6":"ANTHONY "}]' ]; $results['staging_records'][1] = [ 'import_id' => 186, 'customer_id' => 107, 'form_data' => '[{"0":"2017-11-03 12:40:47","1":327,"2":"BR","3":"107","4":"117399795","5":"A","6":"WALT "}]' ]; if (count($results['staging_records'])) { $formData = []; foreach($results['staging_records'] as $data) { $formData[] = [ 'data' => current(json_decode($data['form_data'], true)), 'import_id' => $data['import_id'] ]; } $formJSON = (json_encode($formData)); } var_dump($formData);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 33
filename:       /in/ml20W
function name:  (null)
number of ops:  37
compiled vars:  !0 = $formData, !1 = $results, !2 = $data, !3 = $formJSON
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $5      !1, 'staging_records'
          2        ASSIGN_DIM                                               $5, 0
    5     3        OP_DATA                                                  <array>
   10     4        FETCH_DIM_W                                      $7      !1, 'staging_records'
          5        ASSIGN_DIM                                               $7, 1
   11     6        OP_DATA                                                  <array>
   16     7        FETCH_DIM_R                                      ~9      !1, 'staging_records'
          8        COUNT                                            ~10     ~9
          9      > JMPZ                                                     ~10, ->33
   17    10    >   ASSIGN                                                   !0, <array>
   19    11        FETCH_DIM_R                                      ~12     !1, 'staging_records'
         12      > FE_RESET_R                                       $13     ~12, ->28
         13    > > FE_FETCH_R                                               $13, !2, ->28
   21    14    >   INIT_FCALL                                               'current'
         15        INIT_FCALL                                               'json_decode'
         16        FETCH_DIM_R                                      ~15     !2, 'form_data'
         17        SEND_VAL                                                 ~15
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        SEND_VAR                                                 $16
         21        DO_ICALL                                         $17     
         22        INIT_ARRAY                                       ~18     $17, 'data'
   22    23        FETCH_DIM_R                                      ~19     !2, 'import_id'
         24        ADD_ARRAY_ELEMENT                                ~18     ~19, 'import_id'
   20    25        ASSIGN_DIM                                               !0
   22    26        OP_DATA                                                  ~18
   19    27      > JMP                                                      ->13
         28    >   FE_FREE                                                  $13
   27    29        INIT_FCALL                                               'json_encode'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $20     
         32        ASSIGN                                                   !3, $20
   30    33    >   INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.87 ms | 1396 KiB | 21 Q