3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '0' => Array ( 'created_at' => 1991, 'updated_at' => 1992, 'customer_name' => 'john doe', 'line_items' => Array ( '0' => Array ( 'name' => 'Hello world poduct', 'price' => 800.00, 'id' => 123, 'quantity' => 2 ), '1' => Array ( 'name' => 'Hello world product 2', 'price' => 100.00, 'id' => 456, 'quantity' => 1 ) ) ), '1' => Array ( 'created_at' => 1992, 'updated_at' => 1993, 'customer_name' => 'Guido van Rossum', 'line_items' => Array ( '0' => Array ( 'name' => 'Hello world product', 'price' => 800.00, 'id' => 123, 'quantity' => 2 ), '1' => Array ( 'name' => 'Hello world poduct 2', 'price' => 100.00, 'id' => 456, 'quantity' => 3 ), '2' => Array ( 'name' => 'Hello world poduct 3', 'price' => 400.00, 'id' => 116, 'quantity' => 5 ) ) ) ); $result = []; foreach ($array as ['line_items' => $items]) { array_push($result, ...array_column($items, 'quantity')); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/PHUMA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $result, !2 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   63     1        ASSIGN                                                   !1, <array>
   64     2      > FE_RESET_R                                       $5      !0, ->17
          3    > > FE_FETCH_R                                               $5, $6, ->17
          4    >   FETCH_LIST_R                                     $7      $6, 'line_items'
          5        ASSIGN                                                   !2, $7
          6        FREE                                                     $6
   65     7        INIT_FCALL                                               'array_push'
          8        SEND_REF                                                 !1
          9        INIT_FCALL                                               'array_column'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 'quantity'
         12        DO_ICALL                                         $9      
         13        SEND_UNPACK                                              $9
         14        CHECK_UNDEF_ARGS                                         
         15        DO_ICALL                                                 
   64    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $5
   67    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.02 ms | 1000 KiB | 16 Q