3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Holds the diffs $diffContainer = array(); // Some numbers? $numbers = array(16,8,4,2); foreach($numbers as $currentNumberLevel => &$number) { // There is no difference between zero and the number before if($currentNumberLevel === 0) { continue; } // Calculate the diffs // > Addition $diffContainer['addition'][$currentNumberLevel] = $numbers[($currentNumberLevel - 1)] + $number; // > Subtraction $diffContainer['subtraction'][$currentNumberLevel] = $numbers[($currentNumberLevel - 1)] - $number; // > Multiplication $diffContainer['multiplication'][$currentNumberLevel] = $numbers[($currentNumberLevel - 1)] * $number; // > Division $diffContainer['division'][$currentNumberLevel] = $numbers[($currentNumberLevel - 1)] / $number; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 33
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 33
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/oYDf8
function name:  (null)
number of ops:  35
compiled vars:  !0 = $diffContainer, !1 = $numbers, !2 = $number, !3 = $currentNumberLevel
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   ASSIGN                                                   !0, <array>
   7     1        ASSIGN                                                   !1, <array>
   9     2      > FE_RESET_RW                                      $6      !1, ->33
         3    > > FE_FETCH_RW                                      ~7      $6, !2, ->33
         4    >   ASSIGN                                                   !3, ~7
  11     5        IS_IDENTICAL                                     ~9      !3, 0
         6      > JMPZ                                                     ~9, ->8
  12     7    > > JMP                                                      ->3
  17     8    >   SUB                                              ~12     !3, 1
         9        FETCH_DIM_R                                      $13     !1, ~12
        10        ADD                                              ~14     $13, !2
        11        FETCH_DIM_W                                      $10     !0, 'addition'
        12        ASSIGN_DIM                                               $10, !3
        13        OP_DATA                                                  ~14
  19    14        SUB                                              ~17     !3, 1
        15        FETCH_DIM_R                                      $18     !1, ~17
        16        SUB                                              ~19     $18, !2
        17        FETCH_DIM_W                                      $15     !0, 'subtraction'
        18        ASSIGN_DIM                                               $15, !3
        19        OP_DATA                                                  ~19
  21    20        SUB                                              ~22     !3, 1
        21        FETCH_DIM_R                                      $23     !1, ~22
        22        MUL                                              ~24     $23, !2
        23        FETCH_DIM_W                                      $20     !0, 'multiplication'
        24        ASSIGN_DIM                                               $20, !3
        25        OP_DATA                                                  ~24
  23    26        SUB                                              ~27     !3, 1
        27        FETCH_DIM_R                                      $28     !1, ~27
        28        DIV                                              ~29     $28, !2
        29        FETCH_DIM_W                                      $25     !0, 'division'
        30        ASSIGN_DIM                                               $25, !3
        31        OP_DATA                                                  ~29
        32      > JMP                                                      ->3
        33    >   FE_FREE                                                  $6
  24    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0