3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < $codeLength; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
Branch analysis from position: 7
filename:       /in/QdeNf
function name:  (null)
number of ops:  23
compiled vars:  !0 = $alphabet, !1 = $pass, !2 = $alphaLength, !3 = $i, !4 = $n, !5 = $codeLength
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789'
    3     1        ASSIGN                                                   !1, <array>
    4     2        STRLEN                                           ~8      !0
          3        SUB                                              ~9      ~8, 1
          4        ASSIGN                                                   !2, ~9
    5     5        ASSIGN                                                   !3, 0
          6      > JMP                                                      ->16
    6     7    >   INIT_FCALL                                               'rand'
          8        SEND_VAL                                                 0
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !4, $12
    7    12        FETCH_DIM_R                                      ~15     !0, !4
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~15
    5    15        PRE_INC                                                  !3
         16    >   IS_SMALLER                                               !3, !5
         17      > JMPNZ                                                    ~17, ->7
    9    18    >   INIT_FCALL                                               'implode'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $18     
         21      > RETURN                                                   $18
         22*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.57 ms | 1395 KiB | 17 Q