3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'OK MPD 0.23.5', 'repeat: 0', 'random: 0', 'single: 0', 'consume: 1', 'partition: default', 'playlist: 11292', 'playlistlength: 1', 'mixrampdb: 0', 'state: play', 'song: 0', 'songid: 3', 'time: 14992:0', 'elapsed: 14992.067', 'bitrate: 48', 'audio: 44100:16:2', 'OK', ]; $result = []; foreach ($array as $v) { if (preg_match('/([^:]+): (.*)/', $v, $m)) { $result[$m[1]] = $m[2]; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/u9Zlm
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $result, !2 = $v, !3 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        ASSIGN                                                   !1, <array>
   24     2      > FE_RESET_R                                       $6      !0, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
   25     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%28%5B%5E%3A%5D%2B%29%3A+%28.%2A%29%2F'
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->14
   26    10    >   FETCH_DIM_R                                      ~8      !3, 1
         11        FETCH_DIM_R                                      ~10     !3, 2
         12        ASSIGN_DIM                                               !1, ~8
         13        OP_DATA                                                  ~10
   24    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   29    16        INIT_FCALL                                               'var_export'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.23 ms | 1014 KiB | 15 Q