3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = json_decode('{"Name":"Consultation", "ServiceId":"1024", "Price":".00"}'); $b = json_decode('{"StartTime": "9:15AM", "ServiceId": "1024"}'); $c = (object)array_merge((array)$a, (array)$b); var_dump($c); $a = json_decode('{"Name":"Consultation", "ServiceId":"1024", "Price":".00"}', true); $b = json_decode('{"StartTime": "9:15AM", "ServiceId": "1024"}', true); $c = array_merge($a, $b); var_dump($c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dvNB2
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22Name%22%3A%22Consultation%22%2C+%22ServiceId%22%3A%221024%22%2C+%22Price%22%3A%22.00%22%7D'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        INIT_FCALL                                               'json_decode'
          5        SEND_VAL                                                 '%7B%22StartTime%22%3A+%229%3A15AM%22%2C+%22ServiceId%22%3A+%221024%22%7D'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    5     8        INIT_FCALL                                               'array_merge'
          9        CAST                                          7  ~7      !0
         10        SEND_VAL                                                 ~7
         11        CAST                                          7  ~8      !1
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        CAST                                          8  ~10     $9
         15        ASSIGN                                                   !2, ~10
    6    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
    8    19        INIT_FCALL                                               'json_decode'
         20        SEND_VAL                                                 '%7B%22Name%22%3A%22Consultation%22%2C+%22ServiceId%22%3A%221024%22%2C+%22Price%22%3A%22.00%22%7D'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !0, $13
    9    24        INIT_FCALL                                               'json_decode'
         25        SEND_VAL                                                 '%7B%22StartTime%22%3A+%229%3A15AM%22%2C+%22ServiceId%22%3A+%221024%22%7D'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $15     
         28        ASSIGN                                                   !1, $15
   10    29        INIT_FCALL                                               'array_merge'
         30        SEND_VAR                                                 !0
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $17     
         33        ASSIGN                                                   !2, $17
   11    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.36 ms | 1401 KiB | 19 Q