3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array( array( "type" => "a", "value" => 1 ), array( "type" => "a", "value" => 2 ), array( "type" => "a", "value" => 3 ), array( "type" => "b", "value" => 1 ), array( "type" => "b", "value" => 2 ),array( "type" => "b", "value" => 4 ), array( "type" => "f", "value" => 2 ) ); foreach ($array as $element) $newArray[$element["type"]][] = $element["value"]; var_export($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/4lLfi
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $element, !2 = $newArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   32     1      > FE_RESET_R                                           $4      !0, ->9
          2    > > FE_FETCH_R                                                   $4, !1, ->9
   33     3    >   FETCH_DIM_R                                          ~5      !1, 'type'
          4        FETCH_DIM_R                                          ~8      !1, 'value'
          5        FETCH_DIM_W                                          $6      !2, ~5
          6        ASSIGN_DIM                                                   $6
          7        OP_DATA                                                      ~8
   32     8      > JMP                                                          ->2
          9    >   FE_FREE                                                      $4
   35    10        INIT_FCALL                                                   'var_export'
         11        SEND_VAR                                                     !2
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
231.8 ms | 2557 KiB | 9 Q