3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gray_encode() { for($j=1; $j<32; $j++) { echo '<h1>' .$j , "</h1><br/>"; $powered = number_format( pow(2, $j) -1 , 0, '.', ''); $lineNumber = 1; for ($i = number_format( ( $powered - $j)+1, 0, '.', ''); $i < number_format( ($powered+1), 0, '.', ''); $i++) { echo '<strong>' .$lineNumber . '</strong>. '; $decbin = decbin($i ^ ($i >> 1)); echo '-----'.bindec($decbin) . '----- '; echo $decbin ."<br/>"; $lineNumber++; } echo '<hr>'; } } //fscanf(STDIN, "%d\n", $number); gray_encode();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rTaqp
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'gray_encode'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function gray_encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 2
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 28
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 2
Branch analysis from position: 60
Branch analysis from position: 2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 28
Branch analysis from position: 56
Branch analysis from position: 28
filename:       /in/rTaqp
function name:  gray_encode
number of ops:  61
compiled vars:  !0 = $j, !1 = $powered, !2 = $lineNumber, !3 = $i, !4 = $decbin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->58
    7     2    >   CONCAT                                           ~6      '%3Ch1%3E', !0
          3        ECHO                                                     ~6
          4        ECHO                                                     '%3C%2Fh1%3E%3Cbr%2F%3E'
    8     5        INIT_FCALL                                               'number_format'
          6        INIT_FCALL                                               'pow'
          7        SEND_VAL                                                 2
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        SUB                                              ~8      $7, 1
         11        SEND_VAL                                                 ~8
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 '.'
         14        SEND_VAL                                                 ''
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !1, $9
    9    17        ASSIGN                                                   !2, 1
   10    18        INIT_FCALL                                               'number_format'
         19        SUB                                              ~12     !1, !0
         20        ADD                                              ~13     ~12, 1
         21        SEND_VAL                                                 ~13
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 '.'
         24        SEND_VAL                                                 ''
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !3, $14
         27      > JMP                                                      ->47
   11    28    >   CONCAT                                           ~16     '%3Cstrong%3E', !2
         29        CONCAT                                           ~17     ~16, '%3C%2Fstrong%3E.++++'
         30        ECHO                                                     ~17
   13    31        INIT_FCALL                                               'decbin'
         32        SR                                               ~18     !3, 1
         33        BW_XOR                                           ~19     !3, ~18
         34        SEND_VAL                                                 ~19
         35        DO_ICALL                                         $20     
         36        ASSIGN                                                   !4, $20
   14    37        INIT_FCALL                                               'bindec'
         38        SEND_VAR                                                 !4
         39        DO_ICALL                                         $22     
         40        CONCAT                                           ~23     '-----', $22
         41        CONCAT                                           ~24     ~23, '-----+++'
         42        ECHO                                                     ~24
   15    43        CONCAT                                           ~25     !4, '%3Cbr%2F%3E'
         44        ECHO                                                     ~25
   19    45        PRE_INC                                                  !2
   10    46        PRE_INC                                                  !3
         47    >   INIT_FCALL                                               'number_format'
         48        ADD                                              ~28     !1, 1
         49        SEND_VAL                                                 ~28
         50        SEND_VAL                                                 0
         51        SEND_VAL                                                 '.'
         52        SEND_VAL                                                 ''
         53        DO_ICALL                                         $29     
         54        IS_SMALLER                                               !3, $29
         55      > JMPNZ                                                    ~30, ->28
   21    56    >   ECHO                                                     '%3Chr%3E'
    6    57        PRE_INC                                                  !0
         58    >   IS_SMALLER                                               !0, 32
         59      > JMPNZ                                                    ~32, ->2
   23    60    > > RETURN                                                   null

End of function gray_encode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.51 ms | 1403 KiB | 22 Q