3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"result":{"0":["Adobe FrameMaker Document (.fm, .book)","application\/dca-rft"],"1":["Adobe Illustrator File (.ai)","application\/vnd.illustrator"],"2":["Adobe InDesign File (.indd)","application\/vnd.indesign"],"3":["Adobe Photoshop Document (.psd)","application\/vnd.photoshop"]}}'; $decoded = json_decode($json, true); $saneFormat = []; foreach ($decoded['result'] as $pair) { list($type, $mime) = $pair; $saneFormat[$mime] = $type; } var_dump($saneFormat);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/nAL55
function name:  (null)
number of ops:  24
compiled vars:  !0 = $json, !1 = $decoded, !2 = $saneFormat, !3 = $pair, !4 = $type, !5 = $mime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22result%22%3A%7B%220%22%3A%5B%22Adobe+FrameMaker+Document+%28.fm%2C+.book%29%22%2C%22application%5C%2Fdca-rft%22%5D%2C%221%22%3A%5B%22Adobe+Illustrator+File+%28.ai%29%22%2C%22application%5C%2Fvnd.illustrator%22%5D%2C%222%22%3A%5B%22Adobe+InDesign+File+%28.indd%29%22%2C%22application%5C%2Fvnd.indesign%22%5D%2C%223%22%3A%5B%22Adobe+Photoshop+Document+%28.psd%29%22%2C%22application%5C%2Fvnd.photoshop%22%5D%7D%7D'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    6     6        ASSIGN                                                   !2, <array>
    8     7        FETCH_DIM_R                                      ~10     !1, 'result'
          8      > FE_RESET_R                                       $11     ~10, ->19
          9    > > FE_FETCH_R                                               $11, !3, ->19
    9    10    >   QM_ASSIGN                                        ~12     !3
         11        FETCH_LIST_R                                     $13     ~12, 0
         12        ASSIGN                                                   !4, $13
         13        FETCH_LIST_R                                     $15     ~12, 1
         14        ASSIGN                                                   !5, $15
         15        FREE                                                     ~12
   10    16        ASSIGN_DIM                                               !2, !5
         17        OP_DATA                                                  !4
    8    18      > JMP                                                      ->9
         19    >   FE_FREE                                                  $11
   13    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.87 ms | 1401 KiB | 17 Q