3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "id:5918351498722606 sub:001 dlvrd:001 submit date:1410311037 done date:1410311038 stat:DELIVRD err:000 text:New HTTP Test TxtN"; $pattern = '/([^:]+):([A-Z]{2,}|\d+|\w+(?: \w+)*)/'; preg_match_all($pattern, $str, $matches); $res = array_combine((array_map("trim", $matches[1])), $matches[2]); print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K5YHu
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str, !1 = $pattern, !2 = $matches, !3 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'id%3A5918351498722606+sub%3A001+dlvrd%3A001+submit+date%3A1410311037+done+date%3A1410311038+%0Astat%3ADELIVRD+err%3A000+text%3ANew+HTTP+Test+TxtN'
    5     1        ASSIGN                                                   !1, '%2F%28%5B%5E%3A%5D%2B%29%3A%28%5BA-Z%5D%7B2%2C%7D%7C%5Cd%2B%7C%5Cw%2B%28%3F%3A+%5Cw%2B%29%2A%29%2F'
    6     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'array_combine'
          8        INIT_FCALL                                               'array_map'
          9        SEND_VAL                                                 'trim'
         10        FETCH_DIM_R                                      ~7      !2, 1
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        FETCH_DIM_R                                      ~9      !2, 2
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
    9    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.98 ms | 1002 KiB | 17 Q