3v4l.org

run code in 300+ PHP versions simultaneously
<?php // convert decimal to base 2 without using base_convert or printf $base = 2; $decnum = 23; $num = 23; while( $num > 0) { $arr[] = $num % $base; // store remainder in array $num = floor($num/$base); // no integer division } var_dump($arr); $wrong = join('',$arr); var_dump($wrong); $cat = join('',array_reverse($arr)); var_dump($cat); printf("%b",$decnum); echo base_convert(23,10,2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
Branch analysis from position: 4
filename:       /in/d812b
function name:  (null)
number of ops:  47
compiled vars:  !0 = $base, !1 = $decnum, !2 = $num, !3 = $arr, !4 = $wrong, !5 = $cat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    4     1        ASSIGN                                                   !1, 23
    5     2        ASSIGN                                                   !2, 23
    7     3      > JMP                                                      ->12
    9     4    >   MOD                                              ~10     !2, !0
          5        ASSIGN_DIM                                               !3
          6        OP_DATA                                                  ~10
   10     7        INIT_FCALL                                               'floor'
          8        DIV                                              ~11     !2, !0
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !2, $12
    7    12    >   IS_SMALLER                                               0, !2
         13      > JMPNZ                                                    ~14, ->4
   12    14    >   INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'join'
         18        SEND_VAL                                                 ''
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $16     
         21        ASSIGN                                                   !4, $16
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                                 
   15    25        INIT_FCALL                                               'join'
         26        SEND_VAL                                                 ''
         27        INIT_FCALL                                               'array_reverse'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $19     
         30        SEND_VAR                                                 $19
         31        DO_ICALL                                         $20     
         32        ASSIGN                                                   !5, $20
   16    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                                 
   17    36        INIT_FCALL                                               'printf'
         37        SEND_VAL                                                 '%25b'
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                                 
   18    40        INIT_FCALL                                               'base_convert'
         41        SEND_VAL                                                 23
         42        SEND_VAL                                                 10
         43        SEND_VAL                                                 2
         44        DO_ICALL                                         $24     
         45        ECHO                                                     $24
         46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.39 ms | 1400 KiB | 25 Q