3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dec2hex($number) { $number = strval($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/AYrI6
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 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
Branch analysis from position: 6
filename:       /in/AYrI6
function name:  dec2hex
number of ops:  23
compiled vars:  !0 = $number, !1 = $hexvalues, !2 = $hexval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        CAST                                          6  ~3      !0
          2        ASSIGN                                                   !0, ~3
    6     3        ASSIGN                                                   !1, <array>
    8     4        ASSIGN                                                   !2, ''
    9     5      > JMP                                                      ->19
   11     6    >   INIT_FCALL_BY_NAME                                       'bcmod'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              '16'
          9        DO_FCALL                                      0  $7      
         10        FETCH_DIM_R                                      ~8      !1, $7
         11        CONCAT                                           ~9      ~8, !2
         12        ASSIGN                                                   !2, ~9
   12    13        INIT_FCALL_BY_NAME                                       'bcdiv'
         14        SEND_VAR_EX                                              !0
         15        SEND_VAL_EX                                              '16'
         16        SEND_VAL_EX                                              0
         17        DO_FCALL                                      0  $11     
         18        ASSIGN                                                   !0, $11
    9    19    >   IS_NOT_EQUAL                                             !0, '0'
         20      > JMPNZ                                                    ~13, ->6
   14    21    > > RETURN                                                   !2
   15    22*     > RETURN                                                   null

End of function dec2hex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.26 ms | 1390 KiB | 16 Q