3v4l.org

run code in 300+ PHP versions simultaneously
<?php function string_inthash($str) { $a = (int)preg_replace('#[^0-9]#u', '', sha1($str)) * (int)date('YmdHis'); return (int)$a; } $str = 'secret'; echo string_inthash($str); /* $a = date('YmdHi'); $b = 'secret'; $bb = sha1($b); $bc = preg_replace('#[^0-9]#u', '', $bb); $bd = (int)$bc - (int)$a; $c = "{$b}|{$a}"; $d = base64_encode($c); $e = base64_decode($d); echo $a . PHP_EOL; echo $b . PHP_EOL; echo $bb . PHP_EOL; echo $bc . PHP_EOL; echo $bd . PHP_EOL; echo $c . PHP_EOL; echo $d . PHP_EOL; echo $e . PHP_EOL; */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nhBbr
function name:  (null)
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'secret'
   11     1        INIT_FCALL                                               'string_inthash'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   34     5      > RETURN                                                   1

Function string_inthash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nhBbr
function name:  string_inthash
number of ops:  19
compiled vars:  !0 = $str, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%5B%5E0-9%5D%23u'
          3        SEND_VAL                                                 ''
          4        INIT_FCALL                                               'sha1'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        CAST                                          4  ~4      $3
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'YmdHis'
         12        DO_ICALL                                         $5      
         13        CAST                                          4  ~6      $5
         14        MUL                                              ~7      ~4, ~6
         15        ASSIGN                                                   !1, ~7
    6    16        CAST                                          4  ~9      !1
         17      > RETURN                                                   ~9
    8    18*     > RETURN                                                   null

End of function string_inthash

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.03 ms | 1398 KiB | 20 Q