3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; } for($i = 0; $i < 2000; $i++): echo generateRandomString(8) . PHP_EOL; endfor;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 2
Branch analysis from position: 10
Branch analysis from position: 2
filename:       /in/ZhKKT
function name:  (null)
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->8
   15     2    >   INIT_FCALL                                               'generaterandomstring'
          3        SEND_VAL                                                 8
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      $2, '%0A'
          6        ECHO                                                     ~3
   13     7        PRE_INC                                                  !0
          8    >   IS_SMALLER                                               !0, 2000
          9      > JMPNZ                                                    ~5, ->2
   17    10    > > RETURN                                                   1

Function generaterandomstring:
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/ZhKKT
function name:  generateRandomString
number of ops:  18
compiled vars:  !0 = $length, !1 = $characters, !2 = $randomString, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      10
    4     1        ASSIGN                                                   !1, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    5     2        ASSIGN                                                   !2, ''
    6     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->14
    7     5    >   INIT_FCALL                                               'rand'
          6        SEND_VAL                                                 0
          7        STRLEN                                           ~7      !1
          8        SUB                                              ~8      ~7, 1
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        FETCH_DIM_R                                      ~10     !1, $9
         12        ASSIGN_OP                                     8          !2, ~10
    6    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, !0
         15      > JMPNZ                                                    ~13, ->5
    9    16    > > RETURN                                                   !2
   10    17*     > RETURN                                                   null

End of function generaterandomstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.4 ms | 1399 KiB | 16 Q