3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 'relation' => 'AND', 'key1' => 'Demo', 'value1' => 'demo', 'compare1' => '=', 'type1' => 'NUMERIC', 'key2' => 'test', 'value2' => 'test', 'compare2' => '=', 'type2' => 'NUMERIC', 'key3' => 'test', 'compare3' => '=', 'type3' => 'NUMERIC', 'key4' => 'test', 'value4' => 'test', 'key5' => 'test', 'value5' => 'test', 'compare5' => '=', 'type5' => 'NUMERIC', ); $new = array_splice($arr, 0,1); foreach($arr as $k => $v){ preg_match("/(.*?)(\d+)/", $k, $m); $new[$m[2]-1][$m[1]] = $v; } var_export($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/CHLGT
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $new, !2 = $v, !3 = $k, !4 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'array_splice'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
   27     7      > FE_RESET_R                                       $8      !0, ->22
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->22
          9    >   ASSIGN                                                   !3, ~9
   28    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%28.%2A%3F%29%28%5Cd%2B%29%2F'
         12        SEND_VAR                                                 !3
         13        SEND_REF                                                 !4
         14        DO_ICALL                                                 
   29    15        FETCH_DIM_R                                      ~12     !4, 2
         16        SUB                                              ~13     ~12, 1
         17        FETCH_DIM_R                                      ~15     !4, 1
         18        FETCH_DIM_W                                      $14     !1, ~13
         19        ASSIGN_DIM                                               $14, ~15
         20        OP_DATA                                                  !2
   27    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $8
   31    23        INIT_FCALL                                               'var_export'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.87 ms | 1395 KiB | 19 Q