3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ [ "content" => "Niche description 1", "type" => "niche_des" ], [ "content" => "Niche description 2", "type" => "niche_des" ], [ "content" => "Niche description 3", "type" => "niche_des" ], [ "content" => "Product description 1", "type" => "product_des" ], [ "content" => "Product description 2", "type" => "product_des" ], [ "content" => "Product description 3", "type" => "product_des" ], [ "content" => "Trust site description 1", "type" => "trust_site" ], [ "content" => "Trust site description 2", "type" => "trust_site" ], [ "content" => "Trust site description 3", "type" => "trust_site" ] ]; $result = []; foreach ($data as $row) { $result[ltrim($row['content'], 'A..z ')][$row['type']] = $row['content']; } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ZGiMS
function name:  (null)
number of ops:  23
compiled vars:  !0 = $data, !1 = $result, !2 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   42     1        ASSIGN                                                       !1, <array>
   43     2      > FE_RESET_R                                           $5      !0, ->15
          3    > > FE_FETCH_R                                                   $5, !2, ->15
   44     4    >   INIT_FCALL                                                   'ltrim'
          5        FETCH_DIM_R                                          ~6      !2, 'content'
          6        SEND_VAL                                                     ~6
          7        SEND_VAL                                                     'A..z+'
          8        DO_ICALL                                             $7      
          9        FETCH_DIM_R                                          ~9      !2, 'type'
         10        FETCH_DIM_R                                          ~11     !2, 'content'
         11        FETCH_DIM_W                                          $8      !1, $7
         12        ASSIGN_DIM                                                   $8, ~9
         13        OP_DATA                                                      ~11
   43    14      > JMP                                                          ->3
         15    >   FE_FREE                                                      $5
   46    16        INIT_FCALL                                                   'var_export'
         17        INIT_FCALL                                                   'array_values'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $12     
         20        SEND_VAR                                                     $12
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
144 ms | 1967 KiB | 16 Q