3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP function randString($y) { $r = 'range'; $l = $r(97, 122); $u = $r(65, 90); $n = $r(0, 9); $a = array_merge($l, $u, $n); $s = ""; for ($i=0;$i<$y;$i++) { $x = $a[array_rand($a)]; if ($x > 9) $x = chr($x); $s .= $x; } return $s; } echo randString(3); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMUeZ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'randstring'
          1        SEND_VAL                                                 3
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   20     4      > RETURN                                                   1

Function randstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 26
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 37
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 26
Branch analysis from position: 41
Branch analysis from position: 26
Branch analysis from position: 37
filename:       /in/hMUeZ
function name:  randString
number of ops:  43
compiled vars:  !0 = $y, !1 = $r, !2 = $l, !3 = $u, !4 = $n, !5 = $a, !6 = $s, !7 = $i, !8 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 'range'
    5     2        INIT_DYNAMIC_CALL                                        !1
          3        SEND_VAL_EX                                              97
          4        SEND_VAL_EX                                              122
          5        DO_FCALL                                      0  $10     
          6        ASSIGN                                                   !2, $10
    6     7        INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAL_EX                                              65
          9        SEND_VAL_EX                                              90
         10        DO_FCALL                                      0  $12     
         11        ASSIGN                                                   !3, $12
    7    12        INIT_DYNAMIC_CALL                                        !1
         13        SEND_VAL_EX                                              0
         14        SEND_VAL_EX                                              9
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !4, $14
    8    17        INIT_FCALL                                               'array_merge'
         18        SEND_VAR                                                 !2
         19        SEND_VAR                                                 !3
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !5, $16
    9    23        ASSIGN                                                   !6, ''
   10    24        ASSIGN                                                   !7, 0
         25      > JMP                                                      ->39
   11    26    >   INIT_FCALL                                               'array_rand'
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                         $20     
         29        FETCH_DIM_R                                      ~21     !5, $20
         30        ASSIGN                                                   !8, ~21
   12    31        IS_SMALLER                                               9, !8
         32      > JMPZ                                                     ~23, ->37
         33    >   INIT_FCALL                                               'chr'
         34        SEND_VAR                                                 !8
         35        DO_ICALL                                         $24     
         36        ASSIGN                                                   !8, $24
   13    37    >   ASSIGN_OP                                     8          !6, !8
   10    38        PRE_INC                                                  !7
         39    >   IS_SMALLER                                               !7, !0
         40      > JMPNZ                                                    ~28, ->26
   15    41    > > RETURN                                                   !6
   16    42*     > RETURN                                                   null

End of function randstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.03 ms | 1407 KiB | 20 Q