3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GeneratePassword($length, $chars) { $str = ''; for($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, strlen($chars) - 1)]; } return $str; } var_dump(GeneratePassword(5, 'abcdefghijklmno'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OgTbX
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'generatepassword'
          2        SEND_VAL                                                 5
          3        SEND_VAL                                                 'abcdefghijklmno'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function generatepassword:
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 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/OgTbX
function name:  GeneratePassword
number of ops:  18
compiled vars:  !0 = $length, !1 = $chars, !2 = $str, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, ''
    5     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->14
    7     5    >   INIT_FCALL                                               'rand'
          6        SEND_VAL                                                 0
          7        STRLEN                                           ~6      !1
          8        SUB                                              ~7      ~6, 1
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        FETCH_DIM_R                                      ~9      !1, $8
         12        ASSIGN_OP                                     8          !2, ~9
    5    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !0
         15      > JMPNZ                                                    ~12, ->5
    9    16    > > RETURN                                                   !2
   10    17*     > RETURN                                                   null

End of function generatepassword

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.45 ms | 1399 KiB | 18 Q