3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = '[{"id":"331","file_name":"3b1379e2496408dd4c865f5f63f96bf6","file_path":"https://path/3b1379e2496408dd4c865f5f63f96bf6.png"}, {"id":"332","file_name":"d0ef559473a061086592bceed0880a01","file_path":"https://path/d0ef559473a061086592bceed0880a01.png"}]'; $arr = json_decode($json, true); $output = array_map(fn($value) => (object) ['url' => $value], array_column($arr, 'file_path')); echo json_encode($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a10kB
function name:  (null)
number of ops:  21
compiled vars:  !0 = $json, !1 = $arr, !2 = $output
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%5B%7B%22id%22%3A%22331%22%2C%22file_name%22%3A%223b1379e2496408dd4c865f5f63f96bf6%22%2C%22file_path%22%3A%22https%3A%2F%2Fpath%2F3b1379e2496408dd4c865f5f63f96bf6.png%22%7D%2C%0A%7B%22id%22%3A%22332%22%2C%22file_name%22%3A%22d0ef559473a061086592bceed0880a01%22%2C%22file_path%22%3A%22https%3A%2F%2Fpath%2Fd0ef559473a061086592bceed0880a01.png%22%7D%5D'
    6     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
    8     6        INIT_FCALL                                                   'array_map'
          7        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          8        SEND_VAL                                                     ~6
          9        INIT_FCALL                                                   'array_column'
         10        SEND_VAR                                                     !1
         11        SEND_VAL                                                     'file_path'
         12        DO_ICALL                                             $7      
         13        SEND_VAR                                                     $7
         14        DO_ICALL                                             $8      
         15        ASSIGN                                                       !2, $8
   10    16        INIT_FCALL                                                   'json_encode'
         17        SEND_VAR                                                     !2
         18        DO_ICALL                                             $10     
         19        ECHO                                                         $10
         20      > 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/a10kB
function name:  {closure:/in/a10kB:8}
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        INIT_ARRAY                                           ~1      !0, 'url'
          2        CAST                                              8  ~2      ~1
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.27 ms | 1731 KiB | 17 Q