3v4l.org

run code in 300+ PHP versions simultaneously
<?php function apikey( $length ) { $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; $size = strlen( $chars ); for( $i = 0; $i < $length; $i++ ) { $str= $chars[ rand( 0, $size - 1 ) ]; echo $str; } } $apikey = apikey(32); echo $apikey;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GVpgE
function name:  (null)
number of ops:  6
compiled vars:  !0 = $apikey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'apikey'
          1        SEND_VAL                                                 32
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   15     4        ECHO                                                     !0
   16     5      > RETURN                                                   1

Function apikey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/GVpgE
function name:  apikey
number of ops:  18
compiled vars:  !0 = $length, !1 = $chars, !2 = $size, !3 = $i, !4 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'
    5     2        STRLEN                                           ~6      !1
          3        ASSIGN                                                   !2, ~6
    6     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->15
    7     6    >   INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 0
          8        SUB                                              ~9      !2, 1
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $10     
         11        FETCH_DIM_R                                      ~11     !1, $10
         12        ASSIGN                                                   !4, ~11
    8    13        ECHO                                                     !4
    6    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, !0
         16      > JMPNZ                                                    ~14, ->6
   11    17    > > RETURN                                                   null

End of function apikey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.54 ms | 1448 KiB | 15 Q