3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variations = 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/9mHtj
function name:  (null)
number of ops:  30
compiled vars:  !0 = $variations, !1 = $v, !2 = $nr, !3 = $extendedVariations
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   27     1        FETCH_DIM_R                                      ~5      !0, 'Variation'
          2      > FE_RESET_R                                       $6      ~5, ->28
          3    > > FE_FETCH_R                                       ~7      $6, !1, ->28
          4    >   ASSIGN                                                   !2, ~7
   29     5        FETCH_DIM_R                                      ~10     !1, 'StartPrice'
          6        INIT_ARRAY                                       ~11     ~10, 'StartPrice'
   30     7        FETCH_DIM_R                                      ~12     !1, 'Quantity'
          8        ADD_ARRAY_ELEMENT                                ~11     ~12, 'Quantity'
   28     9        ASSIGN_DIM                                               !3, !2
   30    10        OP_DATA                                                  ~11
   32    11        ARRAY_KEY_EXISTS                                 ~13     'SellingStatus', !1
         12      > JMPZ_EX                                          ~13     ~13, ->16
   33    13    >   FETCH_DIM_R                                      ~14     !1, 'SellingStatus'
         14        ARRAY_KEY_EXISTS                                 ~15     'QuantitySold', ~14
         15        BOOL                                             ~13     ~15
         16    > > JMPZ_EX                                          ~13     ~13, ->21
   34    17    >   FETCH_DIM_R                                      ~16     !1, 'SellingStatus'
         18        FETCH_DIM_R                                      ~17     ~16, 'QuantitySold'
         19        IS_SMALLER                                       ~18     0, ~17
         20        BOOL                                             ~13     ~18
         21    > > JMPZ                                                     ~13, ->27
   36    22    >   FETCH_DIM_R                                      ~21     !1, 'SellingStatus'
         23        FETCH_DIM_R                                      ~22     ~21, 'QuantitySold'
         24        FETCH_DIM_RW                                     $19     !3, !2
         25        ASSIGN_DIM_OP                -=               2          $19, 'Quantity'
         26        OP_DATA                                                  ~22
   27    27    > > JMP                                                      ->3
         28    >   FE_FREE                                                  $6
   38    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.87 ms | 1399 KiB | 13 Q