3v4l.org

run code in 500+ PHP versions simultaneously
<?php $server_seed = "96f3e04d221ca1b2048cc3b3b844e479f2bd9c80a870628072ee98fd1aa83cd0"; // make sure to use non-hashed server seed $public_seed = "20charlongstringxxxxx"; $round = "546"; $hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round); $ticket = hexdec(substr($hash, 0, 15)) % 1000000 + 1; echo("Winning ticket: $ticket");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q0qZP
function name:  (null)
number of ops:  24
compiled vars:  !0 = $server_seed, !1 = $public_seed, !2 = $round, !3 = $hash, !4 = $ticket
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '96f3e04d221ca1b2048cc3b3b844e479f2bd9c80a870628072ee98fd1aa83cd0'
    4     1        ASSIGN                                                       !1, '20charlongstringxxxxx'
    5     2        ASSIGN                                                       !2, '546'
    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        FRAMELESS_ICALL_3                substr              ~14     !3, 0
         14        OP_DATA                                                      15
         15        SEND_VAL                                                     ~14
         16        DO_ICALL                                             $15     
         17        MOD                                                  ~16     $15, 1000000
         18        ADD                                                  ~17     ~16, 1
         19        ASSIGN                                                       !4, ~17
    9    20        NOP                                                          
         21        FAST_CONCAT                                          ~19     'Winning+ticket%3A+', !4
         22        ECHO                                                         ~19
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
189.7 ms | 1663 KiB | 15 Q