3v4l.org

run code in 300+ PHP versions simultaneously
<?php function password($len = 12) { $chars = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; $len = strlen($chars); $multiplier = floor(256 / $len); $byte = (int)openssl_random_pseudo_bytes(1)[0]; return $byte; } echo password();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O4mvF
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'password'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function password:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O4mvF
function name:  password
number of ops:  17
compiled vars:  !0 = $len, !1 = $chars, !2 = $multiplier, !3 = $byte
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      12
    4     1        ASSIGN                                                   !1, 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'
    5     2        STRLEN                                           ~5      !1
          3        ASSIGN                                                   !0, ~5
    6     4        INIT_FCALL                                               'floor'
          5        DIV                                              ~7      256, !0
          6        SEND_VAL                                                 ~7
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    8     9        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
         10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0  $10     
         12        FETCH_DIM_R                                      ~11     $10, 0
         13        CAST                                          4  ~12     ~11
         14        ASSIGN                                                   !3, ~12
   10    15      > RETURN                                                   !3
   11    16*     > RETURN                                                   null

End of function password

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.7 ms | 1398 KiB | 16 Q