3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dec2hex($number) { $number = sprintf('%0.0f', $number); $hexvalues = array('0','1','2','3','4','5','6','7', '8','9','A','B','C','D','E','F'); $hexval = ''; while($number != '0') { $hexval = $hexvalues[bcmod($number,'16')].$hexval; $number = bcdiv($number,'16',0); } return $hexval; } $id = 14910855968770314426; var_dump($id); $guid = dec2hex($id); var_dump($guid);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YoWj8
function name:  (null)
number of ops:  12
compiled vars:  !0 = $id, !1 = $guid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 1.49109e+19
   18     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   19     4        INIT_FCALL                                               'dec2hex'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   20     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function dec2hex:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 9
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 9
Branch analysis from position: 24
Branch analysis from position: 9
filename:       /in/YoWj8
function name:  dec2hex
number of ops:  26
compiled vars:  !0 = $number, !1 = $hexvalues, !2 = $hexval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%250.0f'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    6     6        ASSIGN                                                   !1, <array>
    8     7        ASSIGN                                                   !2, ''
    9     8      > JMP                                                      ->22
   11     9    >   INIT_FCALL_BY_NAME                                       'bcmod'
         10        SEND_VAR_EX                                              !0
         11        SEND_VAL_EX                                              '16'
         12        DO_FCALL                                      0  $7      
         13        FETCH_DIM_R                                      ~8      !1, $7
         14        CONCAT                                           ~9      ~8, !2
         15        ASSIGN                                                   !2, ~9
   12    16        INIT_FCALL_BY_NAME                                       'bcdiv'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAL_EX                                              '16'
         19        SEND_VAL_EX                                              0
         20        DO_FCALL                                      0  $11     
         21        ASSIGN                                                   !0, $11
    9    22    >   IS_NOT_EQUAL                                             !0, '0'
         23      > JMPNZ                                                    ~13, ->9
   14    24    > > RETURN                                                   !2
   15    25*     > RETURN                                                   null

End of function dec2hex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.24 ms | 1403 KiB | 24 Q