3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uuid = sprintf('%04x%04x%04x%04x%04x%04x%04x%04x', // 32 bits for "time_low" mt_rand(0, 0xffff), mt_rand(0, 0xffff), // 16 bits for "time_mid" mt_rand(0, 0xffff), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand(0, 0x0fff) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one // for variant DCE1.1 mt_rand(0, 0x3fff) | 0x8000, // 48 bits for "node" mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) ); $packedUuid = pack('H*', $uuid); $unpackedUuid = unpack('H*', $packedUuid); echo $uuid . PHP_EOL; echo strlen($uuid) . PHP_EOL; echo $packedUuid . PHP_EOL; echo strlen($packedUuid) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j3RbX
function name:  (null)
number of ops:  67
compiled vars:  !0 = $uuid, !1 = $packedUuid, !2 = $unpackedUuid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'sprintf'
          1        SEND_VAL                                                 '%2504x%2504x%2504x%2504x%2504x%2504x%2504x%2504x'
    5     2        INIT_FCALL                                               'mt_rand'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 65535
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        INIT_FCALL                                               'mt_rand'
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 65535
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
    7    12        INIT_FCALL                                               'mt_rand'
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 65535
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
   10    17        INIT_FCALL                                               'mt_rand'
         18        SEND_VAL                                                 0
         19        SEND_VAL                                                 4095
         20        DO_ICALL                                         $6      
         21        BW_OR                                            ~7      $6, 16384
         22        SEND_VAL                                                 ~7
   15    23        INIT_FCALL                                               'mt_rand'
         24        SEND_VAL                                                 0
         25        SEND_VAL                                                 16383
         26        DO_ICALL                                         $8      
         27        BW_OR                                            ~9      $8, 32768
         28        SEND_VAL                                                 ~9
   17    29        INIT_FCALL                                               'mt_rand'
         30        SEND_VAL                                                 0
         31        SEND_VAL                                                 65535
         32        DO_ICALL                                         $10     
         33        SEND_VAR                                                 $10
         34        INIT_FCALL                                               'mt_rand'
         35        SEND_VAL                                                 0
         36        SEND_VAL                                                 65535
         37        DO_ICALL                                         $11     
         38        SEND_VAR                                                 $11
         39        INIT_FCALL                                               'mt_rand'
         40        SEND_VAL                                                 0
         41        SEND_VAL                                                 65535
         42        DO_ICALL                                         $12     
         43        SEND_VAR                                                 $12
         44        DO_ICALL                                         $13     
    3    45        ASSIGN                                                   !0, $13
   20    46        INIT_FCALL                                               'pack'
         47        SEND_VAL                                                 'H%2A'
         48        SEND_VAR                                                 !0
         49        DO_ICALL                                         $15     
         50        ASSIGN                                                   !1, $15
   21    51        INIT_FCALL                                               'unpack'
         52        SEND_VAL                                                 'H%2A'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                         $17     
         55        ASSIGN                                                   !2, $17
   23    56        CONCAT                                           ~19     !0, '%0A'
         57        ECHO                                                     ~19
   24    58        STRLEN                                           ~20     !0
         59        CONCAT                                           ~21     ~20, '%0A'
         60        ECHO                                                     ~21
   25    61        CONCAT                                           ~22     !1, '%0A'
         62        ECHO                                                     ~22
   26    63        STRLEN                                           ~23     !1
         64        CONCAT                                           ~24     ~23, '%0A'
         65        ECHO                                                     ~24
         66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.62 ms | 1400 KiB | 21 Q