3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json1 = '[{"date":"10","comment":"some comment","user":"john"}]'; $json2 = '[{"date":"11","comment":"another quote","user":"jim"}]'; $array1 = json_decode($json1,true); $array2 = json_decode($json2,true); $final = array_merge($array1, $array2); echo json_encode($final); print_r($final);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BC40c
function name:  (null)
number of ops:  25
compiled vars:  !0 = $json1, !1 = $json2, !2 = $array1, !3 = $array2, !4 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22date%22%3A%2210%22%2C%22comment%22%3A%22some+comment%22%2C%22user%22%3A%22john%22%7D%5D'
    3     1        ASSIGN                                                   !1, '%5B%7B%22date%22%3A%2211%22%2C%22comment%22%3A%22another+quote%22%2C%22user%22%3A%22jim%22%7D%5D'
    5     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    6     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
    8    12        INIT_FCALL                                               'array_merge'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !4, $11
   10    17        INIT_FCALL                                               'json_encode'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $13     
         20        ECHO                                                     $13
   11    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.43 ms | 1395 KiB | 21 Q