3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rand_string($nb_char) { $ascii = array_merge(range(65,90), range(97,122),range(48,57)); $string = ''; for($i=0;$i<intval($nb_char);$i++) { $string.= chr($ascii[(mt_rand(0,count($ascii) - 1))]); } return $string;}echo rand_string(8);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qAW4N
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'rand_string'
          1        SEND_VAL                                                 8
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function rand_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 22
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 22
Branch analysis from position: 37
Branch analysis from position: 22
filename:       /in/qAW4N
function name:  rand_string
number of ops:  39
compiled vars:  !0 = $nb_char, !1 = $ascii, !2 = $string, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_merge'
          2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 65
          4        SEND_VAL                                                 90
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        INIT_FCALL                                               'range'
          8        SEND_VAL                                                 97
          9        SEND_VAL                                                 122
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        INIT_FCALL                                               'range'
         13        SEND_VAL                                                 48
         14        SEND_VAL                                                 57
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !1, $7
         19        ASSIGN                                                   !2, ''
         20        ASSIGN                                                   !3, 0
         21      > JMP                                                      ->34
         22    >   INIT_FCALL                                               'chr'
         23        INIT_FCALL                                               'mt_rand'
         24        SEND_VAL                                                 0
         25        COUNT                                            ~11     !1
         26        SUB                                              ~12     ~11, 1
         27        SEND_VAL                                                 ~12
         28        DO_ICALL                                         $13     
         29        FETCH_DIM_R                                      ~14     !1, $13
         30        SEND_VAL                                                 ~14
         31        DO_ICALL                                         $15     
         32        ASSIGN_OP                                     8          !2, $15
         33        PRE_INC                                                  !3
         34    >   CAST                                          4  ~18     !0
         35        IS_SMALLER                                               !3, ~18
         36      > JMPNZ                                                    ~19, ->22
         37    > > RETURN                                                   !2
         38*     > RETURN                                                   null

End of function rand_string

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.65 ms | 1403 KiB | 22 Q