3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo $chars = "abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ!@#$%&*()_-+="; function randStr($length = 32, $chars = "abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ!@#$%&*()_-+=") { //function randStr($length, $chars) { $validCharNumber = strlen($chars); for ($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, $validCharNumber - 1)]; } return $str; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dduLI
function name:  (null)
number of ops:  3
compiled vars:  !0 = $chars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                           ~1      !0, 'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ%21%40%23%24%25%26%2A%28%29_-%2B%3D'
          1        ECHO                                                     ~1
   11     2      > RETURN                                                   1

Function randstr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/dduLI
function name:  randStr
number of ops:  18
compiled vars:  !0 = $length, !1 = $chars, !2 = $validCharNumber, !3 = $i, !4 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      32
          1        RECV_INIT                                        !1      'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ%21%40%23%24%25%26%2A%28%29_-%2B%3D'
    6     2        STRLEN                                           ~5      !1
          3        ASSIGN                                                   !2, ~5
    7     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->14
    8     6    >   INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 0
          8        SUB                                              ~8      !2, 1
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        FETCH_DIM_R                                      ~10     !1, $9
         12        ASSIGN_OP                                     8          !4, ~10
    7    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !0
         15      > JMPNZ                                                    ~13, ->6
   10    16    > > RETURN                                                   !4
   11    17*     > RETURN                                                   null

End of function randstr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.16 ms | 1395 KiB | 15 Q