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', ); $new = array_merge(array_splice($arr, 0,1), array_chunk($arr, 4, true)); foreach($new as &$a){ if(is_array($a)) $a = array_combine(["key", "value", "compare", "type"],$a); } var_export($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 126) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 25
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/LQil4
function name:  (null)
number of ops:  31
compiled vars:  !0 = $arr, !1 = $new, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'array_merge'
          2        INIT_FCALL                                               'array_splice'
          3        SEND_REF                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        INIT_FCALL                                               'array_chunk'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 4
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !1, $6
   16    16      > FE_RESET_RW                                      $8      !1, ->26
         17    > > FE_FETCH_RW                                              $8, !2, ->26
   17    18    >   TYPE_CHECK                                  128          !2
         19      > JMPZ                                                     ~9, ->25
         20    >   INIT_FCALL                                               'array_combine'
         21        SEND_VAL                                                 <array>
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $10     
         24        ASSIGN                                                   !2, $10
   16    25    > > JMP                                                      ->17
         26    >   FE_FREE                                                  $8
   19    27        INIT_FCALL                                               'var_export'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.1 ms | 944 KiB | 24 Q