3v4l.org

run code in 300+ PHP versions simultaneously
<?php function guid(){ if (function_exists('com_create_guid')){ return com_create_guid(); }else{ mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45);// "-" $uuid = chr(123)// "{" .substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12) .chr(125);// "}" return $uuid; } } echo guid();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/emili
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'guid'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function guid:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/emili
function name:  guid
number of ops:  67
compiled vars:  !0 = $charid, !1 = $hyphen, !2 = $uuid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'com_create_guid'
          2        DO_ICALL                                         $3      
          3      > JMPZ                                                     $3, ->8
    5     4    >   INIT_FCALL_BY_NAME                                       'com_create_guid'
          5        DO_FCALL                                      0  $4      
          6      > RETURN                                                   $4
          7*       JMP                                                      ->66
    7     8    >   INIT_FCALL                                               'mt_srand'
          9        INIT_FCALL                                               'microtime'
         10        DO_ICALL                                         $5      
         11        CAST                                          5  ~6      $5
         12        MUL                                              ~7      ~6, 10000
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
    8    15        INIT_FCALL                                               'strtoupper'
         16        INIT_FCALL                                               'md5'
         17        INIT_FCALL                                               'uniqid'
         18        INIT_FCALL                                               'rand'
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $10     
         23        SEND_VAR                                                 $10
         24        DO_ICALL                                         $11     
         25        SEND_VAR                                                 $11
         26        DO_ICALL                                         $12     
         27        ASSIGN                                                   !0, $12
    9    28        ASSIGN                                                   !1, '-'
   11    29        INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 0
         32        SEND_VAL                                                 8
         33        DO_ICALL                                         $15     
         34        CONCAT                                           ~16     '%7B', $15
         35        CONCAT                                           ~17     ~16, !1
   12    36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !0
         38        SEND_VAL                                                 8
         39        SEND_VAL                                                 4
         40        DO_ICALL                                         $18     
         41        CONCAT                                           ~19     ~17, $18
         42        CONCAT                                           ~20     ~19, !1
   13    43        INIT_FCALL                                               'substr'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 12
         46        SEND_VAL                                                 4
         47        DO_ICALL                                         $21     
         48        CONCAT                                           ~22     ~20, $21
         49        CONCAT                                           ~23     ~22, !1
   14    50        INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !0
         52        SEND_VAL                                                 16
         53        SEND_VAL                                                 4
         54        DO_ICALL                                         $24     
         55        CONCAT                                           ~25     ~23, $24
         56        CONCAT                                           ~26     ~25, !1
   15    57        INIT_FCALL                                               'substr'
         58        SEND_VAR                                                 !0
         59        SEND_VAL                                                 20
         60        SEND_VAL                                                 12
         61        DO_ICALL                                         $27     
         62        CONCAT                                           ~28     ~26, $27
   16    63        CONCAT                                           ~29     ~28, '%7D'
   10    64        ASSIGN                                                   !2, ~29
   17    65      > RETURN                                                   !2
   19    66*     > RETURN                                                   null

End of function guid

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.21 ms | 1394 KiB | 30 Q