3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_username($string) { return vsprintf('%s%s%d', [...sscanf(strtolower($string), '%s %2s'), random_int(0, 100)]); } var_export(random_username("Mike Test"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKH1P
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'random_username'
          2        SEND_VAL                                                 'Mike+Test'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function random_username:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKH1P
function name:  random_username
number of ops:  21
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'vsprintf'
          2        SEND_VAL                                                 '%25s%25s%25d'
          3        INIT_FCALL                                               'sscanf'
          4        INIT_FCALL                                               'strtolower'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        SEND_VAL                                                 '%25s+%252s'
          9        DO_ICALL                                         $2      
         10        INIT_ARRAY                                       ~3      
         11        ADD_ARRAY_UNPACK                                 ~3      $2
         12        INIT_FCALL                                               'random_int'
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 100
         15        DO_ICALL                                         $4      
         16        ADD_ARRAY_ELEMENT                                ~3      $4
         17        SEND_VAL                                                 ~3
         18        DO_ICALL                                         $5      
         19      > RETURN                                                   $5
    5    20*     > RETURN                                                   null

End of function random_username

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.19 ms | 1005 KiB | 19 Q