3v4l.org

run code in 300+ 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 = 16
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
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:  42
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, ->16
         15    > > EXIT                                                     'Fill+in+details'
   15    16    >   INIT_FCALL                                               'hash'
         17        SEND_VAL                                                 'sha256'
         18        CONCAT                                           ~14     !2, '%7C'
         19        CONCAT                                           ~15     ~14, !1
         20        SEND_VAL                                                 ~15
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !4, $16
   16    23        INIT_FCALL                                               'ceil'
         24        CAST                                          4  ~18     !3
         25        CAST                                          5  ~19     !2
         26        MUL                                              ~20     ~18, ~19
         27        SEND_VAL                                                 ~20
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !5, $21
   18    30        IS_EQUAL                                                 !0, !4
         31      > JMPZ                                                     ~23, ->34
         32    >   QM_ASSIGN                                        ~24     'Yes'
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~24     'No'
         35    >   CONCAT                                           ~25     'Hash+matches%3A+', ~24
         36        CONCAT                                           ~26     ~25, '%0A'
         37        ECHO                                                     ~26
   19    38        CONCAT                                           ~27     'Winning+ticket%3A+', !5
         39        CONCAT                                           ~28     ~27, '%0A'
         40        ECHO                                                     ~28
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.2 ms | 1449 KiB | 15 Q