3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_rand_str($len){ $result=''; $chars=preg_split('//','abcdef0123456789'); for($i=0;$i<$len;$i++) $result.=$chars[rand(0,count($chars)-1)]; return $result; } echo get_rand_str(12);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o7OJl
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'get_rand_str'
          1        SEND_VAL                                                 12
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function get_rand_str:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
Branch analysis from position: 9
filename:       /in/o7OJl
function name:  get_rand_str
number of ops:  22
compiled vars:  !0 = $len, !1 = $result, !2 = $chars, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%2F%2F'
          4        SEND_VAL                                                 'abcdef0123456789'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    6     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->18
          9    >   INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 0
         11        COUNT                                            ~8      !2
         12        SUB                                              ~9      ~8, 1
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        FETCH_DIM_R                                      ~11     !2, $10
         16        ASSIGN_OP                                     8          !1, ~11
         17        PRE_INC                                                  !3
         18    >   IS_SMALLER                                               !3, !0
         19      > JMPNZ                                                    ~14, ->9
    7    20    > > RETURN                                                   !1
    8    21*     > RETURN                                                   null

End of function get_rand_str

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.46 ms | 1399 KiB | 18 Q