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) . $this->campaign->getId() . 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/HcvXP
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/HcvXP
function name:  generateSecretKey
number of ops:  54
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        FETCH_THIS                                       $12     
         29        FETCH_OBJ_R                                      ~13     $12, 'campaign'
         30        INIT_METHOD_CALL                                         ~13, 'getId'
         31        DO_FCALL                                      0  $14     
         32        CONCAT                                           ~15     $11, $14
         33        CONCAT                                           ~16     ~15, '23'
         34        SEND_VAL                                                 ~16
         35        DO_ICALL                                         $17     
         36        ASSIGN                                                   !2, $17
   10    37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !2
         39        INIT_FCALL                                               'mt_rand'
         40        SEND_VAL                                                 0
         41        STRLEN                                           ~19     !2
         42        SUB                                              ~20     ~19, !1
         43        SEND_VAL                                                 ~20
         44        DO_ICALL                                         $21     
         45        SEND_VAR                                                 $21
         46        INIT_FCALL                                               'mt_rand'
         47        SEND_VAR                                                 !0
         48        SEND_VAR                                                 !1
         49        DO_ICALL                                         $22     
         50        SEND_VAR                                                 $22
         51        DO_ICALL                                         $23     
         52      > RETURN                                                   $23
   11    53*     > RETURN                                                   null

End of function generatesecretkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.34 ms | 1403 KiB | 28 Q