3v4l.org

run code in 300+ PHP versions simultaneously
<?php $token = hash('sha512', mt_getrandmax() . microtime(TRUE)); $_SESSION['token'] = $token; ?> <form action="" method ="POST"> <input type="hidden" name ="token" value="<?= $token ?>"> <input type="text" name="search" id="search" value ="<?= isset($_POST['search']) ? $_POST['search'] : "" ?>" > <input type="submit" value="Go"> </form> <?php if (isset($_POST['token'])) { echo $_POST['token'] == $_SESSION['token'] ? 'true' : 'false'; var_dump($_SESSION); echo '<br />'; echo '<br />'; var_dump($_POST); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 50
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 50
Branch analysis from position: 30
Branch analysis from position: 50
filename:       /in/f4jJI
function name:  (null)
number of ops:  51
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'hash'
          1        SEND_VAL                                                 'sha512'
          2        INIT_FCALL                                               'mt_getrandmax'
          3        DO_ICALL                                         $1      
          4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        CONCAT                                           ~3      $1, $2
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !0, $4
    3    11        FETCH_W                      global              $6      '_SESSION'
         12        ASSIGN_DIM                                               $6, 'token'
         13        OP_DATA                                                  !0
    5    14        ECHO                                                     '%0A%3Cform+action%3D%22%22+method+%3D%22POST%22%3E%0A%3Cinput+type%3D%22hidden%22+name+%3D%22token%22+value%3D%22'
    7    15        ECHO                                                     !0
         16        ECHO                                                     '%22%3E%0A%3Cinput+type%3D%22text%22+name%3D%22search%22+id%3D%22search%22+value+%3D%22'
    8    17        FETCH_IS                                         ~8      '_POST'
         18        ISSET_ISEMPTY_DIM_OBJ                         0          ~8, 'search'
         19      > JMPZ                                                     ~9, ->24
         20    >   FETCH_R                      global              ~10     '_POST'
         21        FETCH_DIM_R                                      ~11     ~10, 'search'
         22        QM_ASSIGN                                        ~12     ~11
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~12     ''
         25    >   ECHO                                                     ~12
         26        ECHO                                                     '%22+%3E%0A%3Cinput+type%3D%22submit%22+value%3D%22Go%22%3E%0A%3C%2Fform%3E%0A%09%09%0A%0A'
   15    27        FETCH_IS                                         ~13     '_POST'
         28        ISSET_ISEMPTY_DIM_OBJ                         0          ~13, 'token'
         29      > JMPZ                                                     ~14, ->50
   16    30    >   FETCH_R                      global              ~15     '_POST'
         31        FETCH_DIM_R                                      ~16     ~15, 'token'
         32        FETCH_R                      global              ~17     '_SESSION'
         33        FETCH_DIM_R                                      ~18     ~17, 'token'
         34        IS_EQUAL                                                 ~16, ~18
         35      > JMPZ                                                     ~19, ->38
         36    >   QM_ASSIGN                                        ~20     'true'
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~20     'false'
         39    >   ECHO                                                     ~20
   18    40        INIT_FCALL                                               'var_dump'
         41        FETCH_R                      global              ~21     '_SESSION'
         42        SEND_VAL                                                 ~21
         43        DO_ICALL                                                 
   19    44        ECHO                                                     '%3Cbr+%2F%3E'
   20    45        ECHO                                                     '%3Cbr+%2F%3E'
   21    46        INIT_FCALL                                               'var_dump'
         47        FETCH_R                      global              ~23     '_POST'
         48        SEND_VAL                                                 ~23
         49        DO_ICALL                                                 
   22    50    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1400 KiB | 21 Q