3v4l.org

run code in 500+ PHP versions simultaneously
<?php $s = 'FOO:317263 BAR:abcd BAZ:s fsiu sfd sdf s dfsdddddd'; $a = array(); foreach (explode("\n", $s) as $line) { $chnk = explode(':', $line, 2); $a[$chnk[0]] = $chnk[1]; } print_r($a); $a = array(); if (preg_match_all('~^(\w+)\h*:\h*(.+)~m', $s, $matches)) { $a = array_combine($matches[1],$matches[2]); } print_r($a);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 19
filename:       /in/8qMSg
function name:  (null)
number of ops:  41
compiled vars:  !0 = $s, !1 = $a, !2 = $line, !3 = $chnk, !4 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'FOO%3A317263%0ABAR%3Aabcd%0ABAZ%3As+fsiu+sfd+sdf+s+dfsdddddd'
    7     1        ASSIGN                                                       !1, <array>
    8     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%0A'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $7      
          6      > FE_RESET_R                                           $8      $7, ->19
          7    > > FE_FETCH_R                                                   $8, !2, ->19
    9     8    >   INIT_FCALL                                                   'explode'
          9        SEND_VAL                                                     '%3A'
         10        SEND_VAR                                                     !2
         11        SEND_VAL                                                     2
         12        DO_ICALL                                             $9      
         13        ASSIGN                                                       !3, $9
   10    14        FETCH_DIM_R                                          ~11     !3, 0
         15        FETCH_DIM_R                                          ~13     !3, 1
         16        ASSIGN_DIM                                                   !1, ~11
         17        OP_DATA                                                      ~13
    8    18      > JMP                                                          ->7
         19    >   FE_FREE                                                      $8
   12    20        INIT_FCALL                                                   'print_r'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
   14    23        ASSIGN                                                       !1, <array>
   15    24        INIT_FCALL                                                   'preg_match_all'
         25        SEND_VAL                                                     '%7E%5E%28%5Cw%2B%29%5Ch%2A%3A%5Ch%2A%28.%2B%29%7Em'
         26        SEND_VAR                                                     !0
         27        SEND_REF                                                     !4
         28        DO_ICALL                                             $16     
         29      > JMPZ                                                         $16, ->37
   16    30    >   INIT_FCALL                                                   'array_combine'
         31        FETCH_DIM_R                                          ~17     !4, 1
         32        SEND_VAL                                                     ~17
         33        FETCH_DIM_R                                          ~18     !4, 2
         34        SEND_VAL                                                     ~18
         35        DO_ICALL                                             $19     
         36        ASSIGN                                                       !1, $19
   18    37    >   INIT_FCALL                                                   'print_r'
         38        SEND_VAR                                                     !1
         39        DO_ICALL                                                     
         40      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.19 ms | 2067 KiB | 17 Q