3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randomString($length = 6) { $str = ""; $characters = array_merge(range('A','Z'), range('a','z'), range('0','9')); $max = count($characters) - 1; for ($i = 0; $i < $length; $i++) { $rand = mt_rand(0, $max); $str .= $characters[$rand]; } return $str; } echo randomString();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZqXvZ
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'randomstring'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function randomstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 25
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 25
Branch analysis from position: 35
Branch analysis from position: 25
filename:       /in/ZqXvZ
function name:  randomString
number of ops:  37
compiled vars:  !0 = $length, !1 = $str, !2 = $characters, !3 = $max, !4 = $i, !5 = $rand
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      6
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL                                               'array_merge'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 'A'
          5        SEND_VAL                                                 'Z'
          6        DO_ICALL                                         $7      
          7        SEND_VAR                                                 $7
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 'a'
         10        SEND_VAL                                                 'z'
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 '0'
         15        SEND_VAL                                                 '9'
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !2, $10
    6    20        COUNT                                            ~12     !2
         21        SUB                                              ~13     ~12, 1
         22        ASSIGN                                                   !3, ~13
    8    23        ASSIGN                                                   !4, 0
         24      > JMP                                                      ->33
    9    25    >   INIT_FCALL                                               'mt_rand'
         26        SEND_VAL                                                 0
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $16     
         29        ASSIGN                                                   !5, $16
         30        FETCH_DIM_R                                      ~18     !2, !5
         31        ASSIGN_OP                                     8          !1, ~18
    8    32        PRE_INC                                                  !4
         33    >   IS_SMALLER                                               !4, !0
         34      > JMPNZ                                                    ~21, ->25
   10    35    > > RETURN                                                   !1
   11    36*     > RETURN                                                   null

End of function randomstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.7 ms | 1403 KiB | 20 Q