3v4l.org

run code in 300+ 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:  27
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        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 15
         17        DO_ICALL                                         $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                         $15     
         20        MOD                                              ~16     $15, 1000000
         21        ADD                                              ~17     ~16, 1
         22        ASSIGN                                                   !4, ~17
    9    23        NOP                                                      
         24        FAST_CONCAT                                      ~19     'Winning+ticket%3A+', !4
         25        ECHO                                                     ~19
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.24 ms | 1012 KiB | 16 Q