3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'prijs=0,209&orderby=price&order=undefined&posts_per_page=undefined'; $array = preg_split('/[&]/' , $str); $filters = array(); foreach ($array as $a) { $values = preg_split('/[=]/' , $a); echo $values[0]; $key = $values[0]; $filters[$key][] = $values[1]; //preg_split('/[,]/' , $values[1]); } var_dump($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/PWaVn
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str, !1 = $array, !2 = $filters, !3 = $a, !4 = $values, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'prijs%3D0%2C209%26orderby%3Dprice%26order%3Dundefined%26posts_per_page%3Dundefined'
    4     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%5B%26%5D%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6        ASSIGN                                                   !2, <array>
    7     7      > FE_RESET_R                                       $10     !1, ->23
          8    > > FE_FETCH_R                                               $10, !3, ->23
    9     9    >   INIT_FCALL                                               'preg_split'
         10        SEND_VAL                                                 '%2F%5B%3D%5D%2F'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !4, $11
   10    14        FETCH_DIM_R                                      ~13     !4, 0
         15        ECHO                                                     ~13
   11    16        FETCH_DIM_R                                      ~14     !4, 0
         17        ASSIGN                                                   !5, ~14
   12    18        FETCH_DIM_R                                      ~18     !4, 1
         19        FETCH_DIM_W                                      $16     !2, !5
         20        ASSIGN_DIM                                               $16
         21        OP_DATA                                                  ~18
    7    22      > JMP                                                      ->8
         23    >   FE_FREE                                                  $10
   16    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.9 ms | 1396 KiB | 17 Q