3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json1 =' { "error": "trueee", "info": { "collections": [{ "ID": "1" }, { "ID": "36" }, { "ID": "2" }] } } '; $json2 =' { "error": "trueee", "info": { "collections": [{ "ID": "12" }, { "ID": "6" }, { "ID": "16" }] } } '; $arr1 = json_decode($json1, true); $arr2 = json_decode($json2, true); $arr1 = array_column($arr1['info']['collections'], "ID"); $arr2 = array_column($arr2['info']['collections'], "ID"); $arr = array_merge($arr1, $arr2); sort($arr); echo '<pre>'; print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hgavr
function name:  (null)
number of ops:  39
compiled vars:  !0 = $json1, !1 = $json2, !2 = $arr1, !3 = $arr2, !4 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%7B%0A++++%22error%22%3A+%22trueee%22%2C%0A++++%22info%22%3A+%7B%0A++++++++%22collections%22%3A+%5B%7B%0A++++++++++++%22ID%22%3A+%221%22%0A++++++++%7D%2C+%7B%0A++++++++++++%22ID%22%3A+%2236%22%0A++++++++%7D%2C+%7B%0A++++++++++++%22ID%22%3A+%222%22%0A++++++++%7D%5D%0A++++%7D%0A%7D%0A'
   17     1        ASSIGN                                                   !1, '%0A%7B%0A++++%22error%22%3A+%22trueee%22%2C%0A++++%22info%22%3A+%7B%0A++++++++%22collections%22%3A+%5B%7B%0A++++++++++++%22ID%22%3A+%2212%22%0A++++++++%7D%2C+%7B%0A++++++++++++%22ID%22%3A+%226%22%0A++++++++%7D%2C+%7B%0A++++++++++++%22ID%22%3A+%2216%22%0A++++++++%7D%5D%0A++++%7D%0A%7D%0A'
   32     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   33     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   35    12        INIT_FCALL                                               'array_column'
         13        FETCH_DIM_R                                      ~11     !2, 'info'
         14        FETCH_DIM_R                                      ~12     ~11, 'collections'
         15        SEND_VAL                                                 ~12
         16        SEND_VAL                                                 'ID'
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !2, $13
   36    19        INIT_FCALL                                               'array_column'
         20        FETCH_DIM_R                                      ~15     !3, 'info'
         21        FETCH_DIM_R                                      ~16     ~15, 'collections'
         22        SEND_VAL                                                 ~16
         23        SEND_VAL                                                 'ID'
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !3, $17
   38    26        INIT_FCALL                                               'array_merge'
         27        SEND_VAR                                                 !2
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $19     
         30        ASSIGN                                                   !4, $19
   39    31        INIT_FCALL                                               'sort'
         32        SEND_REF                                                 !4
         33        DO_ICALL                                                 
   40    34        ECHO                                                     '%3Cpre%3E'
   41    35        INIT_FCALL                                               'print_r'
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.81 ms | 1400 KiB | 23 Q