3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="key1=value 1 key2=value 2 key3=val 3"; var_export(array_chunk(preg_split('~=| (?=\w+=)~', $text), 2)); echo "\n---\n"; var_export(array_chunk(preg_split('~ ?(\w+)=~', $text, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE), 2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GCUq1
function name:  (null)
number of ops:  27
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'key1%3Dvalue+1+key2%3Dvalue+2+key3%3Dval+3'
    4     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'array_chunk'
          3        INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%7E%3D%7C+%28%3F%3D%5Cw%2B%3D%29%7E'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
    5    12        ECHO                                                     '%0A---%0A'
    6    13        INIT_FCALL                                               'var_export'
         14        INIT_FCALL                                               'array_chunk'
         15        INIT_FCALL                                               'preg_split'
         16        SEND_VAL                                                 '%7E+%3F%28%5Cw%2B%29%3D%7E'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 null
         19        SEND_VAL                                                 3
         20        DO_ICALL                                         $5      
         21        SEND_VAR                                                 $5
         22        SEND_VAL                                                 2
         23        DO_ICALL                                         $6      
         24        SEND_VAR                                                 $6
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.57 ms | 1399 KiB | 19 Q