3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateHash($delka_retezce,$capt=false) { if ($capt==true) $mozne_znaky='123456789ABCDEFGHIJKLMNPQRSTUVWXYZ'; else $mozne_znaky='abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $vystup=''; for ($i=0;$i<$delka_retezce;$i++) $vystup.=$mozne_znaky[mt_rand(0,strlen($mozne_znaky)-1)]; return $vystup; } function generateServerSeed() { $rand_nr=mt_rand(0.01*100,99.99*100)/100; if (mt_rand(0,1)==1) $pre_rand=($rand_nr-0.01); else $pre_rand=($rand_nr+0.01); $str=generateHash(26).'-'.((double)(($pre_rand+0.001).mt_rand(0,99999999999999999999999999999))); return $str; } function newPlayer() { $serverseed=generateServerSeed(); $seedhash=substr($serverseed,0,27); $zzserverseed=(double)substr($serverseed,27); $z=$seedhash.sprintf("%.32f",$zzserverseed); echo $z."<br>"; echo hash('sha256', $z)."<br>"; } $m=microtime(true); $a=2646681480; mt_srand($a); newPlayer(); $n=microtime(true); echo $n-$m; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKvDg
function name:  (null)
number of ops:  17
compiled vars:  !0 = $m, !1 = $a, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
   34     4        ASSIGN                                                   !1, 2646681480
   38     5        INIT_FCALL                                               'mt_srand'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   40     8        INIT_FCALL                                               'newplayer'
          9        DO_FCALL                                      0          
   41    10        INIT_FCALL                                               'microtime'
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   42    14        SUB                                              ~10     !2, !0
         15        ECHO                                                     ~10
   44    16      > RETURN                                                   1

Function generatehash:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 10
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 10
Branch analysis from position: 21
Branch analysis from position: 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
filename:       /in/TKvDg
function name:  generateHash
number of ops:  23
compiled vars:  !0 = $delka_retezce, !1 = $capt, !2 = $mozne_znaky, !3 = $vystup, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
    4     2        BOOL                                             ~5      !1
          3      > JMPZ                                                     ~5, ->6
          4    >   ASSIGN                                                   !2, '123456789ABCDEFGHIJKLMNPQRSTUVWXYZ'
          5      > JMP                                                      ->7
    5     6    >   ASSIGN                                                   !2, 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    6     7    >   ASSIGN                                                   !3, ''
    7     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->19
         10    >   INIT_FCALL                                               'mt_rand'
         11        SEND_VAL                                                 0
         12        STRLEN                                           ~10     !2
         13        SUB                                              ~11     ~10, 1
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                         $12     
         16        FETCH_DIM_R                                      ~13     !2, $12
         17        ASSIGN_OP                                     8          !3, ~13
         18        PRE_INC                                                  !4
         19    >   IS_SMALLER                                               !4, !0
         20      > JMPNZ                                                    ~16, ->10
    8    21    > > RETURN                                                   !3
    9    22*     > RETURN                                                   null

End of function generatehash

Function generateserverseed:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKvDg
function name:  generateServerSeed
number of ops:  32
compiled vars:  !0 = $rand_nr, !1 = $pre_rand, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'mt_rand'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 9999
          3        DO_ICALL                                         $3      
          4        DIV                                              ~4      $3, 100
          5        ASSIGN                                                   !0, ~4
   13     6        INIT_FCALL                                               'mt_rand'
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $6      
         10        IS_EQUAL                                                 $6, 1
         11      > JMPZ                                                     ~7, ->15
         12    >   SUB                                              ~8      !0, 0.01
         13        ASSIGN                                                   !1, ~8
         14      > JMP                                                      ->17
   14    15    >   ADD                                              ~10     !0, 0.01
         16        ASSIGN                                                   !1, ~10
   15    17    >   INIT_FCALL                                               'generatehash'
         18        SEND_VAL                                                 26
         19        DO_FCALL                                      0  $12     
         20        CONCAT                                           ~13     $12, '-'
         21        ADD                                              ~14     !1, 0.001
         22        INIT_FCALL                                               'mt_rand'
         23        SEND_VAL                                                 0
         24        SEND_VAL                                                 1.0e+29
         25        DO_ICALL                                         $15     
         26        CONCAT                                           ~16     ~14, $15
         27        CAST                                          5  ~17     ~16
         28        CONCAT                                           ~18     ~13, ~17
         29        ASSIGN                                                   !2, ~18
   16    30      > RETURN                                                   !2
   17    31*     > RETURN                                                   null

End of function generateserverseed

Function newplayer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TKvDg
function name:  newPlayer
number of ops:  30
compiled vars:  !0 = $serverseed, !1 = $seedhash, !2 = $zzserverseed, !3 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'generateserverseed'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
   23     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 27
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   24     9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 27
         12        DO_ICALL                                         $8      
         13        CAST                                          5  ~9      $8
         14        ASSIGN                                                   !2, ~9
   26    15        INIT_FCALL                                               'sprintf'
         16        SEND_VAL                                                 '%25.32f'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     !1, $11
         20        ASSIGN                                                   !3, ~12
   27    21        CONCAT                                           ~14     !3, '%3Cbr%3E'
         22        ECHO                                                     ~14
   28    23        INIT_FCALL                                               'hash'
         24        SEND_VAL                                                 'sha256'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                         $15     
         27        CONCAT                                           ~16     $15, '%3Cbr%3E'
         28        ECHO                                                     ~16
   31    29      > RETURN                                                   null

End of function newplayer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.21 ms | 1406 KiB | 28 Q