3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ (object) [ "book" => "book 1", "n_ano" => "2013", ], (object) [ "book" => "book 2", "n_ano" => "2012", ], (object) [ "book" => "book 3", "n_ano" => "2013", ], ]; foreach($arr as $v) $data[$v->n_ano][] = $v->book; foreach($data as $n_ano => $books) { echo $n_ano . "<br>"; foreach($books as $book) echo " - " . $book . "<br>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 29
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 15
filename:       /in/hl0qf
function name:  (null)
number of ops:  31
compiled vars:  !0 = $arr, !1 = $v, !2 = $data, !3 = $books, !4 = $n_ano, !5 = $book
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   CAST                                          8  ~6      <array>
          1        INIT_ARRAY                                       ~7      ~6
    9     2        CAST                                          8  ~8      <array>
          3        ADD_ARRAY_ELEMENT                                ~7      ~8
   13     4        CAST                                          8  ~9      <array>
          5        ADD_ARRAY_ELEMENT                                ~7      ~9
    3     6        ASSIGN                                                   !0, ~7
   19     7      > FE_RESET_R                                       $11     !0, ->15
          8    > > FE_FETCH_R                                               $11, !1, ->15
   20     9    >   FETCH_OBJ_R                                      ~12     !1, 'n_ano'
         10        FETCH_OBJ_R                                      ~15     !1, 'book'
         11        FETCH_DIM_W                                      $13     !2, ~12
         12        ASSIGN_DIM                                               $13
         13        OP_DATA                                                  ~15
   19    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $11
   22    16      > FE_RESET_R                                       $16     !2, ->29
         17    > > FE_FETCH_R                                       ~17     $16, !3, ->29
         18    >   ASSIGN                                                   !4, ~17
   23    19        CONCAT                                           ~19     !4, '%3Cbr%3E'
         20        ECHO                                                     ~19
   24    21      > FE_RESET_R                                       $20     !3, ->27
         22    > > FE_FETCH_R                                               $20, !5, ->27
   25    23    >   CONCAT                                           ~21     '+-+', !5
         24        CONCAT                                           ~22     ~21, '%3Cbr%3E'
         25        ECHO                                                     ~22
   24    26      > JMP                                                      ->22
         27    >   FE_FREE                                                  $20
   22    28      > JMP                                                      ->17
         29    >   FE_FREE                                                  $16
   26    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.42 ms | 1395 KiB | 13 Q