3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_password( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } echo generate_password(6); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SURUs
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'generate_password'
          1        SEND_VAL                                                 6
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   10     4      > RETURN                                                   1

Function generate_password:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SURUs
function name:  generate_password
number of ops:  13
compiled vars:  !0 = $length, !1 = $chars, !2 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      8
    3     1        ASSIGN                                                   !1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    4     2        INIT_FCALL                                               'substr'
          3        INIT_FCALL                                               'str_shuffle'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 0
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !2, $5
    5    11      > RETURN                                                   !2
    6    12*     > RETURN                                                   null

End of function generate_password

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.4 ms | 1389 KiB | 18 Q