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 = []; foreach ($arr as $item) { $output[] = ["url" => $item["file_path"]]; } echo json_encode($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/JcKZE
function name:  (null)
number of ops:  20
compiled vars:  !0 = $json, !1 = $arr, !2 = $output, !3 = $item
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                                             $5      
          5        ASSIGN                                                       !1, $5
    8     6        ASSIGN                                                       !2, <array>
    9     7      > FE_RESET_R                                           $8      !1, ->14
          8    > > FE_FETCH_R                                                   $8, !3, ->14
   11     9    >   FETCH_DIM_R                                          ~10     !3, 'file_path'
         10        INIT_ARRAY                                           ~11     ~10, 'url'
         11        ASSIGN_DIM                                                   !2
         12        OP_DATA                                                      ~11
    9    13      > JMP                                                          ->8
         14    >   FE_FREE                                                      $8
   14    15        INIT_FCALL                                                   'json_encode'
         16        SEND_VAR                                                     !2
         17        DO_ICALL                                             $12     
         18        ECHO                                                         $12
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
133.98 ms | 1728 KiB | 15 Q