3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all five below and click blue 'Something is wrong();' button below textarea. * * ------------------ */ $hash = ''; #Round number hash SHA256 $secret = ''; #Round number $number = ''; #Round number $tickets = ''; #Round total tickets /* ------------------ */ if ($hash == '' || $secret == '' || $number == ''|| $tickets == '') exit("Fill in details"); $sha256 = hash('sha256', $number.'|'.$secret); $ticket = ceil(intval($tickets)*floatval($number)); echo "Hash matches: ".($hash == $sha256 ? 'Yes': 'No')."\n"; echo "Winning ticket: ".$ticket."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 11
Branch analysis from position: 8
filename:       /in/ucOJH
function name:  (null)
number of ops:  44
compiled vars:  !0 = $hash, !1 = $secret, !2 = $number, !3 = $tickets, !4 = $sha256, !5 = $ticket
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                       !0, ''
    8     1        ASSIGN                                                       !1, ''
    9     2        ASSIGN                                                       !2, ''
   10     3        ASSIGN                                                       !3, ''
   13     4        IS_EQUAL                                             ~10     !0, ''
          5      > JMPNZ_EX                                             ~10     ~10, ->8
          6    >   IS_EQUAL                                             ~11     !1, ''
          7        BOOL                                                 ~10     ~11
          8    > > JMPNZ_EX                                             ~10     ~10, ->11
          9    >   IS_EQUAL                                             ~12     !2, ''
         10        BOOL                                                 ~10     ~12
         11    > > JMPNZ_EX                                             ~10     ~10, ->14
         12    >   IS_EQUAL                                             ~13     !3, ''
         13        BOOL                                                 ~10     ~13
         14    > > JMPZ                                                         ~10, ->18
         15    > > INIT_FCALL                                                   'exit'
         16*       SEND_VAL                                                     'Fill+in+details'
         17*       DO_ICALL                                                     
   15    18    >   INIT_FCALL                                                   'hash'
         19        SEND_VAL                                                     'sha256'
         20        CONCAT                                               ~15     !2, '%7C'
         21        CONCAT                                               ~16     ~15, !1
         22        SEND_VAL                                                     ~16
         23        DO_ICALL                                             $17     
         24        ASSIGN                                                       !4, $17
   16    25        INIT_FCALL                                                   'ceil'
         26        CAST                                              4  ~19     !3
         27        CAST                                              5  ~20     !2
         28        MUL                                                  ~21     ~19, ~20
         29        SEND_VAL                                                     ~21
         30        DO_ICALL                                             $22     
         31        ASSIGN                                                       !5, $22
   18    32        IS_EQUAL                                                     !0, !4
         33      > JMPZ                                                         ~24, ->36
         34    >   QM_ASSIGN                                            ~25     'Yes'
         35      > JMP                                                          ->37
         36    >   QM_ASSIGN                                            ~25     'No'
         37    >   CONCAT                                               ~26     'Hash+matches%3A+', ~25
         38        CONCAT                                               ~27     ~26, '%0A'
         39        ECHO                                                         ~27
   19    40        CONCAT                                               ~28     'Winning+ticket%3A+', !5
         41        CONCAT                                               ~29     ~28, '%0A'
         42        ECHO                                                         ~29
         43      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.61 ms | 1992 KiB | 16 Q