3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '[{"COLUMN_NAME":"ORDER_NO","COLUMN_TITLE":"Order Number"},{"COLUMN_NAME":"CUSTOMER_NO","COLUMN_TITLE":"Customer Number"}]'; $b = '[{"COLUMN_NAME":"ORDER_NO","DEFAULT_VALUE":"1521"},{"COLUMN_NAME":"CUSTOMER_NO","DEFAULT_VALUEE":"C1435"}]'; $r = []; foreach(json_decode($a, true) as $key => $arra){ $r[$key] = array_merge(json_decode($b, true)[$key],$arra); } echo json_encode($r);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/sCQ0O
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $r, !3 = $arra, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22COLUMN_NAME%22%3A%22ORDER_NO%22%2C%22COLUMN_TITLE%22%3A%22Order+Number%22%7D%2C%7B%22COLUMN_NAME%22%3A%22CUSTOMER_NO%22%2C%22COLUMN_TITLE%22%3A%22Customer+Number%22%7D%5D'
    3     1        ASSIGN                                                   !1, '%5B%7B%22COLUMN_NAME%22%3A%22ORDER_NO%22%2C%22DEFAULT_VALUE%22%3A%221521%22%7D%2C%7B%22COLUMN_NAME%22%3A%22CUSTOMER_NO%22%2C%22DEFAULT_VALUEE%22%3A%22C1435%22%7D%5D'
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $8      
          7      > FE_RESET_R                                       $9      $8, ->22
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->22
          9    >   ASSIGN                                                   !4, ~10
    6    10        INIT_FCALL                                               'array_merge'
         11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $13     
         15        FETCH_DIM_R                                      ~14     $13, !4
         16        SEND_VAL                                                 ~14
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $15     
         19        ASSIGN_DIM                                               !2, !4
         20        OP_DATA                                                  $15
    5    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $9
    8    23        INIT_FCALL                                               'json_encode'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $16     
         26        ECHO                                                     $16
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.04 ms | 1396 KiB | 19 Q