3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateSecretKey() { $secret_key_length_min = 8; $secret_key_length_max = 12; $chars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9')); shuffle($chars); $chars = sha1(implode('', $chars) . 23); return substr($chars, mt_rand(0, strlen($chars) - $secret_key_length_max), mt_rand($secret_key_length_min, $secret_key_length_max)); } echo generateSecretKey();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/njpdo
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'generatesecretkey'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function generatesecretkey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/njpdo
function name:  generateSecretKey
number of ops:  49
compiled vars:  !0 = $secret_key_length_min, !1 = $secret_key_length_max, !2 = $chars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 8
    6     1        ASSIGN                                                   !1, 12
    7     2        INIT_FCALL                                               'array_merge'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 'a'
          5        SEND_VAL                                                 'z'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 'A'
         10        SEND_VAL                                                 'Z'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 '0'
         15        SEND_VAL                                                 '9'
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !2, $8
    8    20        INIT_FCALL                                               'shuffle'
         21        SEND_REF                                                 !2
         22        DO_ICALL                                                 
    9    23        INIT_FCALL                                               'sha1'
         24        INIT_FCALL                                               'implode'
         25        SEND_VAL                                                 ''
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $11     
         28        CONCAT                                           ~12     $11, '23'
         29        SEND_VAL                                                 ~12
         30        DO_ICALL                                         $13     
         31        ASSIGN                                                   !2, $13
   10    32        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !2
         34        INIT_FCALL                                               'mt_rand'
         35        SEND_VAL                                                 0
         36        STRLEN                                           ~15     !2
         37        SUB                                              ~16     ~15, !1
         38        SEND_VAL                                                 ~16
         39        DO_ICALL                                         $17     
         40        SEND_VAR                                                 $17
         41        INIT_FCALL                                               'mt_rand'
         42        SEND_VAR                                                 !0
         43        SEND_VAR                                                 !1
         44        DO_ICALL                                         $18     
         45        SEND_VAR                                                 $18
         46        DO_ICALL                                         $19     
         47      > RETURN                                                   $19
   11    48*     > RETURN                                                   null

End of function generatesecretkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.37 ms | 1403 KiB | 28 Q