3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_GUID($prefix='pfx') { $uuid = md5(uniqid(rand(), true)); $guid = $prefix.substr($uuid,0,8)."-". substr($uuid,8,4)."-". substr($uuid,12,4)."-". substr($uuid,16,4)."-". substr($uuid,20,12); return $guid; } echo generate_GUID($prefix='pfx');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M42nA
function name:  (null)
number of ops:  6
compiled vars:  !0 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'generate_guid'
          1        ASSIGN                                           ~1      !0, 'pfx'
          2        SEND_VAL                                                 ~1
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function generate_guid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M42nA
function name:  generate_GUID
number of ops:  48
compiled vars:  !0 = $prefix, !1 = $uuid, !2 = $guid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      'pfx'
    4     1        INIT_FCALL                                               'md5'
          2        INIT_FCALL                                               'uniqid'
          3        INIT_FCALL                                               'rand'
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    5    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 8
         15        DO_ICALL                                         $7      
         16        CONCAT                                           ~8      !0, $7
         17        CONCAT                                           ~9      ~8, '-'
    6    18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 8
         21        SEND_VAL                                                 4
         22        DO_ICALL                                         $10     
         23        CONCAT                                           ~11     ~9, $10
         24        CONCAT                                           ~12     ~11, '-'
    7    25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 12
         28        SEND_VAL                                                 4
         29        DO_ICALL                                         $13     
         30        CONCAT                                           ~14     ~12, $13
         31        CONCAT                                           ~15     ~14, '-'
    8    32        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 16
         35        SEND_VAL                                                 4
         36        DO_ICALL                                         $16     
         37        CONCAT                                           ~17     ~15, $16
         38        CONCAT                                           ~18     ~17, '-'
    9    39        INIT_FCALL                                               'substr'
         40        SEND_VAR                                                 !1
         41        SEND_VAL                                                 20
         42        SEND_VAL                                                 12
         43        DO_ICALL                                         $19     
         44        CONCAT                                           ~20     ~18, $19
    5    45        ASSIGN                                                   !2, ~20
   10    46      > RETURN                                                   !2
   11    47*     > RETURN                                                   null

End of function generate_guid

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.8 ms | 1402 KiB | 22 Q