3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ["/?dfs1=frgs1","/?dfs2=frgs2","/?dfs3=frgs3"]; $matches = preg_grep("/\/\?(.*)\=(.*)/", $a); $fmatchs = []; foreach($matches as $match){ $mtchs = explode("=", $match); print($match); print_r($mtchs); foreach($mtchs as $v){ $k = str_replace("/?", "", $v[0]); $fmatchs[$k] = $v[1]; } } print_r($fmatchs);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 33
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 33
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 31
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/edWnJ
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $matches, !2 = $fmatchs, !3 = $match, !4 = $mtchs, !5 = $v, !6 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'preg_grep'
          2        SEND_VAL                                                 '%2F%5C%2F%5C%3F%28.%2A%29%5C%3D%28.%2A%29%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    4     6        ASSIGN                                                   !2, <array>
    5     7      > FE_RESET_R                                       $11     !1, ->33
          8    > > FE_FETCH_R                                               $11, !3, ->33
    6     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%3D'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
    7    14        ECHO                                                     !3
    8    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                                 
    9    18      > FE_RESET_R                                       $15     !4, ->31
         19    > > FE_FETCH_R                                               $15, !5, ->31
   10    20    >   INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 '%2F%3F'
         22        SEND_VAL                                                 ''
         23        FETCH_DIM_R                                      ~16     !5, 0
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !6, $17
   11    27        FETCH_DIM_R                                      ~20     !5, 1
         28        ASSIGN_DIM                                               !2, !6
         29        OP_DATA                                                  ~20
    9    30      > JMP                                                      ->19
         31    >   FE_FREE                                                  $15
    5    32      > JMP                                                      ->8
         33    >   FE_FREE                                                  $11
   14    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.56 ms | 1400 KiB | 21 Q