3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachment = '[{ "contentType": "application/json", "content": { "type": "mytype", "body": [{ "type": "TextInfo", "text": "TEST TEXT", "wrap": true }] } }]'; // Add attachment string (JSON data) in an array $mydata = array( 'space' => "abc", 'markdown' => "**welcome**", 'attachment' => json_decode($attachment) ); // Turn array into one big JSON string $send_json = json_encode($mydata, JSON_PRETTY_PRINT); echo $send_json;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g2Jlo
function name:  (null)
number of ops:  15
compiled vars:  !0 = $attachment, !1 = $mydata, !2 = $send_json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B%0A+++%22contentType%22%3A+%22application%2Fjson%22%2C%0A+++%22content%22%3A+%7B%0A++++++%22type%22%3A+%22mytype%22%2C%0A++++++%22body%22%3A+%5B%7B%0A+++++++++%22type%22%3A+%22TextInfo%22%2C%0A+++++++++%22text%22%3A+%22TEST+TEXT%22%2C%0A+++++++++%22wrap%22%3A+true%0A++++++%7D%5D%0A+++%7D%0A%7D%5D'
   17     1        INIT_ARRAY                                       ~4      'abc', 'space'
   18     2        ADD_ARRAY_ELEMENT                                ~4      '%2A%2Awelcome%2A%2A', 'markdown'
   19     3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ADD_ARRAY_ELEMENT                                ~4      $5, 'attachment'
   16     7        ASSIGN                                                   !1, ~4
   23     8        INIT_FCALL                                               'json_encode'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 128
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   24    13        ECHO                                                     !2
   25    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.12 ms | 1000 KiB | 15 Q