3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bin2dec_i($binary_i) { bcscale(0); $decimal_i = '0'; for ($i = 0; $i < strlen($binary_i); $i++) { $decimal_i = bcmul($decimal_i,'2'); $decimal_i = bcadd($decimal_i,$binary_i[$i]); } return($decimal_i); } var_dump(bin2dec_i('001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100101010100101001001000100010010100100100100100100010001001001001001'));;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YM9d1
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'bin2dec_i'
          2        SEND_VAL                                                 '001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100001010101001010010010001000100101001001001001001000100010010010010010000000000011111111100101010100101001001000100010010100100100100100100010001001001001001'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function bin2dec_i:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
Branch analysis from position: 7
filename:       /in/YM9d1
function name:  bin2dec_i
number of ops:  25
compiled vars:  !0 = $binary_i, !1 = $decimal_i, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL_BY_NAME                                       'bcscale'
          2        SEND_VAL_EX                                              0
          3        DO_FCALL                                      0          
    7     4        ASSIGN                                                   !1, '0'
    8     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->20
   10     7    >   INIT_FCALL_BY_NAME                                       'bcmul'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAL_EX                                              '2'
         10        DO_FCALL                                      0  $6      
         11        ASSIGN                                                   !1, $6
   11    12        INIT_FCALL_BY_NAME                                       'bcadd'
         13        SEND_VAR_EX                                              !1
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $8      !0, !2
         16        SEND_FUNC_ARG                                            $8
         17        DO_FCALL                                      0  $9      
         18        ASSIGN                                                   !1, $9
    8    19        PRE_INC                                                  !2
         20    >   STRLEN                                           ~12     !0
         21        IS_SMALLER                                               !2, ~12
         22      > JMPNZ                                                    ~13, ->7
   14    23    > > RETURN                                                   !1
   15    24*     > RETURN                                                   null

End of function bin2dec_i

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.57 ms | 1403 KiB | 25 Q