3v4l.org

run code in 300+ PHP versions simultaneously
<?php $friends = [ [ [ 'partyplan_select_products' => '1', 'product_name' => 'Books', 'partyplan_amazonurl_product' => 'http://www.flipkart.com', 'partyplan_product_image_id' => '18320', 'partyplan_product_image' => 'http://local.enjoius/wp-content/uploads/2016/11/acktobwufyhopfql.jpg', 'partyplan_min_product_price' => '25.00', 'partyplan_max_product_price' => '30.00', 'partyplan_product_qty' => '0', ], [ 'partyplan_select_products' => '1', 'product_name' => 'Disco Lights', 'partyplan_amazonurl_product' => 'http://www.google.com', 'partyplan_product_image_id' => '18328', 'partyplan_product_image' => 'http://local.enjoius/wp-content/uploads/2016/11/relwwzfpaupcvhlc.jpg', 'partyplan_min_product_price' => '85.00', 'partyplan_max_product_price' => '100.00', 'partyplan_product_qty' => '75', ], [ 'partyplan_select_products' => '1', 'product_name' => 'Table', 'partyplan_amazonurl_product' => 'http://www.google.com', 'partyplan_product_image_id' => '18416', 'partyplan_product_image' => 'http://local.enjoius/wp-content/uploads/2016/11/blog_img.jpg', 'partyplan_min_product_price' => '150.00', 'partyplan_max_product_price' => '500.00', 'partyplan_product_qty' => '15', ], ], [ [ 'partyplan_select_products' => '2', 'product_name' => 'Waiters', 'partyplan_amazonurl_product' => 'http://www.google.com', 'partyplan_product_image_id' => '18373', 'partyplan_product_image' => 'http://local.enjoius/wp-content/uploads/2016/11/20161123011316-8454547519_f8116520e1_b.jpg', 'partyplan_min_product_price' => '150.00', 'partyplan_max_product_price' => '500.00', 'partyplan_product_qty' => '25', ], [ 'partyplan_select_products' => '2', 'product_name' => 'sadasdfs', 'partyplan_amazonurl_product' => 'http://www.google.com', 'partyplan_product_image_id' => '18362', 'partyplan_product_image' => 'http://local.enjoius/wp-content/uploads/2016/11/20161116041623-8215602321_69d9939b8b_b.jpg', 'partyplan_min_product_price' => '150.00', 'partyplan_max_product_price' => '500.00', 'partyplan_product_qty' => '25', ], ] ]; $total_products = 0; $field = 'partyplan_select_products'; foreach ($friends as $friend) { $total_products += array_sum(array_column($friend, $field)); } print_r("$field: " . $total_products);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/jdbv0
function name:  (null)
number of ops:  22
compiled vars:  !0 = $friends, !1 = $total_products, !2 = $field, !3 = $friend
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   60     1        ASSIGN                                                   !1, 0
   62     2        ASSIGN                                                   !2, 'partyplan_select_products'
   64     3      > FE_RESET_R                                       $7      !0, ->14
          4    > > FE_FETCH_R                                               $7, !3, ->14
   65     5    >   INIT_FCALL                                               'array_sum'
          6        INIT_FCALL                                               'array_column'
          7        SEND_VAR                                                 !3
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                         $9      
         12        ASSIGN_OP                                     1          !1, $9
   64    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $7
   68    15        INIT_FCALL                                               'print_r'
         16        NOP                                                      
         17        FAST_CONCAT                                      ~11     !2, '%3A+'
         18        CONCAT                                           ~12     ~11, !1
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.34 ms | 1000 KiB | 16 Q