3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = array ( array( 'body' => 'somevalue1', 'title' => 'somevalue1', 'type' => 'foo' ), array( 'body' => 'somevalue2', 'title' => 'somevalue2', 'type' => 'foo' ), array( 'body' => 'somevalue3', 'title' => 'somevalue3', 'type' => 'bar' ), array( 'body' => 'somevalue4', 'title' => 'somevalue4', 'type' => 'foobar' ), array( 'body' => 'somevalue5', 'title' => 'somevalue5', 'type' => 'foobar' ), array( 'body' => 'somevalue6', 'title' => 'somevalue6', 'type' => 'foobar' ), ); foreach($results as $a){ $output[$a['type']][]=array_slice($a,0,2); } var_export($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/LBESu
function name:  (null)
number of ops:  18
compiled vars:  !0 = $results, !1 = $a, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   35     1      > FE_RESET_R                                       $4      !0, ->13
          2    > > FE_FETCH_R                                               $4, !1, ->13
   36     3    >   FETCH_DIM_R                                      ~5      !1, 'type'
          4        INIT_FCALL                                               'array_slice'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $8      
          9        FETCH_DIM_W                                      $6      !2, ~5
         10        ASSIGN_DIM                                               $6
         11        OP_DATA                                                  $8
   35    12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $4
   38    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.37 ms | 1395 KiB | 17 Q