3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randStr($length = 32, $chars = 'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ!@#$%&*()_-+=') { $validCharNumber = strlen($chars); for ($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, $validCharNumber - 1)]; } return $str; } echo randStr(128);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sFpSV
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'randstr'
          1        SEND_VAL                                                 128
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > 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/sFpSV
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
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      32
          1        RECV_INIT                                        !1      'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ%21%40%23%24%25%26%2A%28%29_-%2B%3D'
    3     2        STRLEN                                           ~5      !1
          3        ASSIGN                                                   !2, ~5
    4     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->14
    5     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
    4    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !0
         15      > JMPNZ                                                    ~13, ->6
    7    16    > > RETURN                                                   !4
    8    17*     > RETURN                                                   null

End of function randstr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.2 ms | 1398 KiB | 16 Q