3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 'Variation' => array( 'SKU' => 'ML328-8.42-21.329', 'StartPrice' => 29.95, 'Quantity' => 1, 'VariationSpecifics' => array( 'NameValueList' => array( 0 => array( 'Name' => 'Farbe', 'Value' => 'schwarz' ), 1 => array( 'Name' => 'Größe', 'Value' => 145, ) ) ), 'SellingStatus' => array( 'QuantitySold' => 0, 'QuantitySoldByPickupInStore' => 0, ) ) ); foreach ($variations['Variation'] as $nr => $v) { $extendedVariations[$nr] = array ( 'StartPrice' => $v['StartPrice'], 'Quantity' => $v['Quantity'] ); if ( (array_key_exists('SellingStatus', $v)) && (array_key_exists('QuantitySold', $v['SellingStatus'])) && ($v['SellingStatus']['QuantitySold'] > 0) ) { $extendedVariations[$nr]['Quantity'] -= $v['SellingStatus']['QuantitySold']; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 21
Branch analysis from position: 16
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/rjXon
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $variations, !2 = $v, !3 = $nr, !4 = $extendedVariations
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   27     1        FETCH_DIM_R                                      ~6      !1, 'Variation'
          2      > FE_RESET_R                                       $7      ~6, ->28
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->28
          4    >   ASSIGN                                                   !3, ~8
   29     5        FETCH_DIM_R                                      ~11     !2, 'StartPrice'
          6        INIT_ARRAY                                       ~12     ~11, 'StartPrice'
   30     7        FETCH_DIM_R                                      ~13     !2, 'Quantity'
          8        ADD_ARRAY_ELEMENT                                ~12     ~13, 'Quantity'
   28     9        ASSIGN_DIM                                               !4, !3
   30    10        OP_DATA                                                  ~12
   32    11        ARRAY_KEY_EXISTS                                 ~14     'SellingStatus', !2
         12      > JMPZ_EX                                          ~14     ~14, ->16
   33    13    >   FETCH_DIM_R                                      ~15     !2, 'SellingStatus'
         14        ARRAY_KEY_EXISTS                                 ~16     'QuantitySold', ~15
         15        BOOL                                             ~14     ~16
         16    > > JMPZ_EX                                          ~14     ~14, ->21
   34    17    >   FETCH_DIM_R                                      ~17     !2, 'SellingStatus'
         18        FETCH_DIM_R                                      ~18     ~17, 'QuantitySold'
         19        IS_SMALLER                                       ~19     0, ~18
         20        BOOL                                             ~14     ~19
         21    > > JMPZ                                                     ~14, ->27
   36    22    >   FETCH_DIM_R                                      ~22     !2, 'SellingStatus'
         23        FETCH_DIM_R                                      ~23     ~22, 'QuantitySold'
         24        FETCH_DIM_RW                                     $20     !4, !3
         25        ASSIGN_DIM_OP                -=               2          $20, 'Quantity'
         26        OP_DATA                                                  ~23
   27    27    > > JMP                                                      ->3
         28    >   FE_FREE                                                  $7
   38    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.08 ms | 1399 KiB | 13 Q