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)[1]; echo $uuid . PHP_EOL; echo strlen($uuid) . PHP_EOL; echo $packedUuid . PHP_EOL; echo strlen($packedUuid) . PHP_EOL; echo $unpackedUuid . PHP_EOL; echo strlen($unpackedUuid) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ovp6P
function name:  (null)
number of ops:  73
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        FETCH_DIM_R                                      ~18     $17, 1
         56        ASSIGN                                                   !2, ~18
   23    57        CONCAT                                           ~20     !0, '%0A'
         58        ECHO                                                     ~20
   24    59        STRLEN                                           ~21     !0
         60        CONCAT                                           ~22     ~21, '%0A'
         61        ECHO                                                     ~22
   25    62        CONCAT                                           ~23     !1, '%0A'
         63        ECHO                                                     ~23
   26    64        STRLEN                                           ~24     !1
         65        CONCAT                                           ~25     ~24, '%0A'
         66        ECHO                                                     ~25
   27    67        CONCAT                                           ~26     !2, '%0A'
         68        ECHO                                                     ~26
   28    69        STRLEN                                           ~27     !2
         70        CONCAT                                           ~28     ~27, '%0A'
         71        ECHO                                                     ~28
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.98 ms | 1392 KiB | 21 Q