3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '[ { "id":"1", "f_name":"Mitrajit", "l_name":"Samanta", "class":"XII", "section":"A,B,C", "roll":"1", "status":"1" } ]'; $json = json_decode($str, true); $json[0]["section"] = explode(",", $json[0]["section"]); $json = json_encode($json); print_r($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8MaIF
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B++%0A+++%7B++%0A++++++%22id%22%3A%221%22%2C%0A++++++%22f_name%22%3A%22Mitrajit%22%2C%0A++++++%22l_name%22%3A%22Samanta%22%2C%0A++++++%22class%22%3A%22XII%22%2C%0A++++++%22section%22%3A%22A%2CB%2CC%22%2C%0A++++++%22roll%22%3A%221%22%2C%0A++++++%22status%22%3A%221%22%0A+++%7D%0A%5D'
   14     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   15     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        FETCH_DIM_R                                      ~7      !1, 0
          9        FETCH_DIM_R                                      ~8      ~7, 'section'
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                         $9      
         12        FETCH_DIM_W                                      $5      !1, 0
         13        ASSIGN_DIM                                               $5, 'section'
         14        OP_DATA                                                  $9
   16    15        INIT_FCALL                                               'json_encode'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !1, $10
   18    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.51 ms | 1005 KiB | 17 Q