3v4l.org

run code in 300+ PHP versions simultaneously
<?php $token = mt_rand() . mt_rand() . mt_rand() . mt_rand(); $_SESSION['token_timestamp'] = time(); $hash_algos = hash_algos(); if (in_array('sha512', $hash_algos)) { $token = hash('sha512', $token, false); } else { $token = sha1($token, false); } var_dump($token);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
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: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtcXJ
function name:  (null)
number of ops:  41
compiled vars:  !0 = $token, !1 = $hash_algos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'mt_rand'
          1        DO_ICALL                                         $2      
          2        INIT_FCALL                                               'mt_rand'
          3        DO_ICALL                                         $3      
          4        CONCAT                                           ~4      $2, $3
          5        INIT_FCALL                                               'mt_rand'
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      ~4, $5
          8        INIT_FCALL                                               'mt_rand'
          9        DO_ICALL                                         $7      
         10        CONCAT                                           ~8      ~6, $7
         11        ASSIGN                                                   !0, ~8
    3    12        INIT_FCALL                                               'time'
         13        DO_ICALL                                         $12     
         14        FETCH_W                      global              $10     '_SESSION'
         15        ASSIGN_DIM                                               $10, 'token_timestamp'
         16        OP_DATA                                                  $12
    4    17        INIT_FCALL                                               'hash_algos'
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !1, $13
    5    20        INIT_FCALL                                               'in_array'
         21        SEND_VAL                                                 'sha512'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $15     
         24      > JMPZ                                                     $15, ->32
    6    25    >   INIT_FCALL                                               'hash'
         26        SEND_VAL                                                 'sha512'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 <false>
         29        DO_ICALL                                         $16     
         30        ASSIGN                                                   !0, $16
         31      > JMP                                                      ->37
    8    32    >   INIT_FCALL                                               'sha1'
         33        SEND_VAR                                                 !0
         34        SEND_VAL                                                 <false>
         35        DO_ICALL                                         $18     
         36        ASSIGN                                                   !0, $18
   10    37    >   INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.71 ms | 1396 KiB | 27 Q