3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_username($string) { return preg_replace('/(\S+) (\S{2}).*/', '$1$2', strtolower($string)) . 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/vqjq0
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/vqjq0
function name:  random_username
number of ops:  16
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5CS%2B%29+%28%5CS%7B2%7D%29.%2A%2F'
          3        SEND_VAL                                                 '%241%242'
          4        INIT_FCALL                                               'strtolower'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        INIT_FCALL                                               'random_int'
         10        SEND_VAL                                                 0
         11        SEND_VAL                                                 100
         12        DO_ICALL                                         $3      
         13        CONCAT                                           ~4      $2, $3
         14      > RETURN                                                   ~4
    5    15*     > RETURN                                                   null

End of function random_username

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.39 ms | 1003 KiB | 18 Q