3v4l.org

run code in 300+ PHP versions simultaneously
<?php $toSort = array( 1 => [ 'value' => 8000, 'key' => 1007 ], 2 => [ 'value' => 8001, 'key' => 1007 ], 3 => [ 'value' => 8002, 'key' => 1013 ], ); $result = []; foreach ($toSort as ['value' => $value, 'key' => $key]) { $result[$key][] = $value; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/j0pQC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $toSort, !1 = $result, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        ASSIGN                                                   !1, <array>
   22     2      > FE_RESET_R                                       $6      !0, ->13
          3    > > FE_FETCH_R                                               $6, $7, ->13
          4    >   FETCH_LIST_R                                     $8      $7, 'value'
          5        ASSIGN                                                   !2, $8
          6        FETCH_LIST_R                                     $10     $7, 'key'
          7        ASSIGN                                                   !3, $10
          8        FREE                                                     $7
   23     9        FETCH_DIM_W                                      $12     !1, !3
         10        ASSIGN_DIM                                               $12
         11        OP_DATA                                                  !2
   22    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $6
   25    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.2 ms | 999 KiB | 14 Q