3v4l.org

run code in 300+ PHP versions simultaneously
<?php function token($length = 30) { $string = str_replace(['=','+','/'], '', base64_encode(sha1(uniqid('',true)))); return substr($string, 0, $length); } echo token();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQ6VG
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'token'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function token:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CQ6VG
function name:  token
number of ops:  24
compiled vars:  !0 = $length, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      30
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 ''
          4        INIT_FCALL                                               'base64_encode'
          5        INIT_FCALL                                               'sha1'
          6        INIT_FCALL                                               'uniqid'
          7        SEND_VAL                                                 ''
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                         $5      
         16        ASSIGN                                                   !1, $5
    5    17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 0
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $7      
         22      > RETURN                                                   $7
    6    23*     > RETURN                                                   null

End of function token

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.43 ms | 1398 KiB | 24 Q