3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '[ { "id": 1, "content": "Reason 1" }, { "id": 2, "content": "Reason 2" }, { "id": 3, "content": "Reason 3" }, { "id": 4, "content": "Reason 4" } ]'; $from = json_decode($content, true); $to = json_encode(array_column($from, 'content', 'id'), JSON_PRETTY_PRINT); echo $to;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WL29a
function name:  (null)
number of ops:  18
compiled vars:  !0 = $content, !1 = $from, !2 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%0A++%7B%0A++++%22id%22%3A+1%2C%0A++++%22content%22%3A+%22Reason+1%22%0A++%7D%2C%0A++%7B%0A++++%22id%22%3A+2%2C%0A++++%22content%22%3A+%22Reason+2%22%0A++%7D%2C%0A++%7B%0A++++%22id%22%3A+3%2C%0A++++%22content%22%3A+%22Reason+3%22%0A++%7D%2C%0A++%7B%0A++++%22id%22%3A+4%2C%0A++++%22content%22%3A+%22Reason+4%22%0A++%7D%0A%5D'
   22     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   23     6        INIT_FCALL                                               'json_encode'
          7        INIT_FCALL                                               'array_column'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 'content'
         10        SEND_VAL                                                 'id'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        SEND_VAL                                                 128
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !2, $7
   25    16        ECHO                                                     !2
   26    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.72 ms | 1001 KiB | 16 Q