3v4l.org

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

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

End of function apikey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.51 ms | 1448 KiB | 15 Q