3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 110, 1 => 111, 2 => 112, 3 => 113, 4 => 109, 5 => 114, 6 => 115, 7 => 116, 8 => 117, 9 => 118, 10 => 120, 11 => 119, 12 => 121, 13 => 122, 14 => 123, 15 => 124, 16 => 125); function mapArrayToBin(array $values) { $bin_value = 0; if (is_array($values)) { foreach (array_keys($values) as $val) { $bin_value += (1 << ($val - 1)); } } return $bin_value; } var_dump(mapArrayToBin($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4dq0P
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'maparraytobin'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function maparraytobin:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 14
filename:       /in/4dq0P
function name:  mapArrayToBin
number of ops:  16
compiled vars:  !0 = $values, !1 = $bin_value, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN                                                   !1, 0
   11     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~4, ->14
   12     4    >   INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7      > FE_RESET_R                                       $6      $5, ->13
          8    > > FE_FETCH_R                                               $6, !2, ->13
   13     9    >   SUB                                              ~7      !2, 1
         10        SL                                               ~8      1, ~7
         11        ASSIGN_OP                                     1          !1, ~8
   12    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $6
   16    14    > > RETURN                                                   !1
   17    15*     > RETURN                                                   null

End of function maparraytobin

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1390 KiB | 18 Q