3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "39b7d32fcb743c244c569a56d6de4dc27577d6277d6cf155bdcba6d05befcb34"; $lotto = "0422262831"; $round_id = "1"; $hash = hash("sha256",$server_seed."-".$lotto."-".$round_id); $roll = hexdec(substr($hash,0,8)) % 37; // Print værdien af $hash print("\$hash = $hash\n"); // Print værdien af substr($hash,0,8) print("substr(\$hash,0,8) = ".(String)substr($hash,0,8)."\n"); // Print værdien af hexdec(substr($hash,0,8)) print("hexdec(856672a7) = ".(String)hexdec(substr($hash,0,8))."\n"); // Print værdien af 856672a7 % 15 print("2238083751 % 37 = ".(2238083751 % 37)."\n"); // Print værdien af roll print("\$roll = $roll"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hVlsA
function name:  (null)
number of ops:  52
compiled vars:  !0 = $server_seed, !1 = $lotto, !2 = $round_id, !3 = $hash, !4 = $roll
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '39b7d32fcb743c244c569a56d6de4dc27577d6277d6cf155bdcba6d05befcb34'
    4     1        ASSIGN                                                   !1, '0422262831'
    5     2        ASSIGN                                                   !2, '1'
    6     3        INIT_FCALL                                               'hash'
          4        SEND_VAL                                                 'sha256'
          5        CONCAT                                           ~8      !0, '-'
          6        CONCAT                                           ~9      ~8, !1
          7        CONCAT                                           ~10     ~9, '-'
          8        CONCAT                                           ~11     ~10, !2
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !3, $12
    7    12        INIT_FCALL                                               'hexdec'
         13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 8
         17        DO_ICALL                                         $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                         $15     
         20        MOD                                              ~16     $15, 37
         21        ASSIGN                                                   !4, ~16
   10    22        ROPE_INIT                                     3  ~19     '%24hash+%3D+'
         23        ROPE_ADD                                      1  ~19     ~19, !3
         24        ROPE_END                                      2  ~18     ~19, '%0A'
         25        ECHO                                                     ~18
   12    26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !3
         28        SEND_VAL                                                 0
         29        SEND_VAL                                                 8
         30        DO_ICALL                                         $21     
         31        CAST                                          6  ~22     $21
         32        CONCAT                                           ~23     'substr%28%24hash%2C0%2C8%29+%3D+', ~22
         33        CONCAT                                           ~24     ~23, '%0A'
         34        ECHO                                                     ~24
   14    35        INIT_FCALL                                               'hexdec'
         36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !3
         38        SEND_VAL                                                 0
         39        SEND_VAL                                                 8
         40        DO_ICALL                                         $25     
         41        SEND_VAR                                                 $25
         42        DO_ICALL                                         $26     
         43        CAST                                          6  ~27     $26
         44        CONCAT                                           ~28     'hexdec%28856672a7%29+%3D+', ~27
         45        CONCAT                                           ~29     ~28, '%0A'
         46        ECHO                                                     ~29
   16    47        ECHO                                                     '2238083751+%25+37+%3D+1%0A'
   18    48        NOP                                                      
         49        FAST_CONCAT                                      ~30     '%24roll+%3D+', !4
         50        ECHO                                                     ~30
   20    51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.37 ms | 1400 KiB | 19 Q