3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayOfString = array( 'customer service[-3] technical support[-3]', 'picture quality[+2]feature[+2]', 'smell[-2]', 'player[+2]', 'player[-3][u]', 'dvd player[-2]', 'player[+2][p]', 'format[+2][u]progressive scan[-2]' ); preg_match_all("/([\w ]+[^[]]*)\[([+-]\d*?)\]/", implode(",", $arrayOfString) , $matches); print_r(array_combine($matches[1], $matches[2]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jAId7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $arrayOfString, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5B%5Cw+%5D%2B%5B%5E%5B%5D%5D%2A%29%5C%5B%28%5B%2B-%5D%5Cd%2A%3F%29%5C%5D%2F'
          3        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        SEND_REF                                                 !1
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'array_combine'
         12        FETCH_DIM_R                                      ~5      !1, 1
         13        SEND_VAL                                                 ~5
         14        FETCH_DIM_R                                      ~6      !1, 2
         15        SEND_VAL                                                 ~6
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.95 ms | 1386 KiB | 21 Q