3v4l.org

run code in 500+ PHP versions simultaneously
<?php function multiexplode ($delimiters,$string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; } $text = "När:Sent lördag kväll och natt till söndag\nVar:Främst norra Jämtland\nIntensitet:Väst ca 21 m/s\nKommentar:Sydväst 14-17 m/s. Avtagande söndag morgon."; $exploded = multiexplode(array("\n",":"), $text); for($i=0;$i<count($exploded);$i++){ $result[$exploded[$i]]= $exploded[++$i]; } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 8
Branch analysis from position: 17
Branch analysis from position: 8
filename:       /in/ptE29
function name:  (null)
number of ops:  21
compiled vars:  !0 = $text, !1 = $exploded, !2 = $i, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                       !0, 'N%C3%A4r%3ASent+l%C3%B6rdag+kv%C3%A4ll+och+natt+till+s%C3%B6ndag%0AVar%3AFr%C3%A4mst+norra+J%C3%A4mtland%0AIntensitet%3AV%C3%A4st+ca+21+m%2Fs%0AKommentar%3ASydv%C3%A4st+14-17+m%2Fs.+Avtagande+s%C3%B6ndag+morgon.'
   12     1        INIT_FCALL                                                   'multiexplode'
          2        SEND_VAL                                                     <array>
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $5      
          5        ASSIGN                                                       !1, $5
   13     6        ASSIGN                                                       !2, 0
          7      > JMP                                                          ->14
   14     8    >   FETCH_DIM_R                                          ~8      !1, !2
          9        PRE_INC                                              ~10     !2
         10        FETCH_DIM_R                                          ~11     !1, ~10
         11        ASSIGN_DIM                                                   !3, ~8
         12        OP_DATA                                                      ~11
   13    13        PRE_INC                                                      !2
         14    >   COUNT                                                ~13     !1
         15        IS_SMALLER                                                   !2, ~13
         16      > JMPNZ                                                        ~14, ->8
   17    17    >   INIT_FCALL                                                   'print_r'
         18        SEND_VAR                                                     !3
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

Function multiexplode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ptE29
function name:  multiexplode
number of ops:  14
compiled vars:  !0 = $delimiters, !1 = $string, !2 = $ready, !3 = $launch
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    5     2        FETCH_DIM_R                                          ~4      !0, 0
          3        FRAMELESS_ICALL_3                str_replace         ~5      !0, ~4
          4        OP_DATA                                                      !1
          5        ASSIGN                                                       !2, ~5
    6     6        INIT_FCALL                                                   'explode'
          7        FETCH_DIM_R                                          ~7      !0, 0
          8        SEND_VAL                                                     ~7
          9        SEND_VAR                                                     !2
         10        DO_ICALL                                             $8      
         11        ASSIGN                                                       !3, $8
    7    12      > RETURN                                                       !3
    8    13*     > RETURN                                                       null

End of function multiexplode

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.83 ms | 2292 KiB | 16 Q