3v4l.org

run code in 500+ PHP versions simultaneously
<?php $jsonString = '[{"value":"jquery"},{"value":"bootstrap"}]'; $array = json_decode($jsonString); $array2 = array_column($array, "value"); $csv = implode(", ", $array2); echo "Comma Separated String: ", $csv, "\n"; $array3 = explode(", ", $csv); $array4 = array_map(function ($val){ $obj = (object)[]; $obj->value=$val; return $obj; }, $array3); $jsonString2 = json_encode($array4); echo "Json String: ", $jsonString2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5vtg
function name:  (null)
number of ops:  33
compiled vars:  !0 = $jsonString, !1 = $array, !2 = $array2, !3 = $csv, !4 = $array3, !5 = $array4, !6 = $jsonString2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%5B%7B%22value%22%3A%22jquery%22%7D%2C%7B%22value%22%3A%22bootstrap%22%7D%5D'
    4     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $8      
          4        ASSIGN                                                       !1, $8
    5     5        INIT_FCALL                                                   'array_column'
          6        SEND_VAR                                                     !1
          7        SEND_VAL                                                     'value'
          8        DO_ICALL                                             $10     
          9        ASSIGN                                                       !2, $10
    6    10        FRAMELESS_ICALL_2                implode             ~12     '%2C+', !2
         11        ASSIGN                                                       !3, ~12
    7    12        ECHO                                                         'Comma+Separated+String%3A+'
         13        ECHO                                                         !3
         14        ECHO                                                         '%0A'
    9    15        INIT_FCALL                                                   'explode'
         16        SEND_VAL                                                     '%2C+'
         17        SEND_VAR                                                     !3
         18        DO_ICALL                                             $14     
         19        ASSIGN                                                       !4, $14
   10    20        INIT_FCALL                                                   'array_map'
         21        DECLARE_LAMBDA_FUNCTION                              ~16     [0]
   14    22        SEND_VAL                                                     ~16
         23        SEND_VAR                                                     !4
   10    24        DO_ICALL                                             $17     
         25        ASSIGN                                                       !5, $17
   15    26        INIT_FCALL                                                   'json_encode'
         27        SEND_VAR                                                     !5
         28        DO_ICALL                                             $19     
         29        ASSIGN                                                       !6, $19
   16    30        ECHO                                                         'Json+String%3A+'
         31        ECHO                                                         !6
   17    32      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5vtg
function name:  {closure:/in/t5vtg:10}
number of ops:  7
compiled vars:  !0 = $val, !1 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        CAST                                              8  ~2      <array>
          2        ASSIGN                                                       !1, ~2
   12     3        ASSIGN_OBJ                                                   !1, 'value'
          4        OP_DATA                                                      !0
   13     5      > RETURN                                                       !1
   14     6*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.19 ms | 2047 KiB | 18 Q