3v4l.org

run code in 300+ PHP versions simultaneously
<?php $offset = strtotime('2000-01-01 00:00:00') * 1000; $time1 = floor(microtime(true) * 1000) - $offset; sleep(1); $time2 = floor(microtime(true) * 1000) - $offset; sleep(1); $time3 = floor(microtime(true) * 1000) - $offset; var_dump(sprintf('%b', $time1)); var_dump(sprintf('%b', $time2)); var_dump(sprintf('%b', $time3)); $datacenter = 1; $machine = 1; $sequence = 1; $id1 = 1 << 63 | $time1 << 22 | $datacenter << 17 | $machine << 12 | $sequence; $id2 = 1 << 63 | $time2 << 22 | $datacenter << 17 | $machine << 12 | $sequence; $id3 = 1 << 63 | $time3 << 22 | $datacenter << 17 | $machine << 12 | $sequence; var_dump(sprintf('%b', $id1)); var_dump(sprintf('%b', $id2)); var_dump(sprintf('%b', $id3)); function bin2base64($entier) { $entier = dechex($entier); $entier = hex2bin($entier); $entier = base64_encode($entier); $entier = str_replace('=', '', $entier); return $entier; } $id1 = bin2base64($id1); $id2 = bin2base64($id2); $id3 = bin2base64($id3); var_dump($id1); var_dump($id2); var_dump($id3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/etJkB
function name:  (null)
number of ops:  129
compiled vars:  !0 = $offset, !1 = $time1, !2 = $time2, !3 = $time3, !4 = $datacenter, !5 = $machine, !6 = $sequence, !7 = $id1, !8 = $id2, !9 = $id3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '2000-01-01+00%3A00%3A00'
          2        DO_ICALL                                         $10     
          3        MUL                                              ~11     $10, 1000
          4        ASSIGN                                                   !0, ~11
    5     5        INIT_FCALL                                               'floor'
          6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $13     
          9        MUL                                              ~14     $13, 1000
         10        SEND_VAL                                                 ~14
         11        DO_ICALL                                         $15     
         12        SUB                                              ~16     $15, !0
         13        ASSIGN                                                   !1, ~16
    6    14        INIT_FCALL                                               'sleep'
         15        SEND_VAL                                                 1
         16        DO_ICALL                                                 
    7    17        INIT_FCALL                                               'floor'
         18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $19     
         21        MUL                                              ~20     $19, 1000
         22        SEND_VAL                                                 ~20
         23        DO_ICALL                                         $21     
         24        SUB                                              ~22     $21, !0
         25        ASSIGN                                                   !2, ~22
    8    26        INIT_FCALL                                               'sleep'
         27        SEND_VAL                                                 1
         28        DO_ICALL                                                 
    9    29        INIT_FCALL                                               'floor'
         30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $25     
         33        MUL                                              ~26     $25, 1000
         34        SEND_VAL                                                 ~26
         35        DO_ICALL                                         $27     
         36        SUB                                              ~28     $27, !0
         37        ASSIGN                                                   !3, ~28
   11    38        INIT_FCALL                                               'var_dump'
         39        INIT_FCALL                                               'sprintf'
         40        SEND_VAL                                                 '%25b'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $30     
         43        SEND_VAR                                                 $30
         44        DO_ICALL                                                 
   12    45        INIT_FCALL                                               'var_dump'
         46        INIT_FCALL                                               'sprintf'
         47        SEND_VAL                                                 '%25b'
         48        SEND_VAR                                                 !2
         49        DO_ICALL                                         $32     
         50        SEND_VAR                                                 $32
         51        DO_ICALL                                                 
   13    52        INIT_FCALL                                               'var_dump'
         53        INIT_FCALL                                               'sprintf'
         54        SEND_VAL                                                 '%25b'
         55        SEND_VAR                                                 !3
         56        DO_ICALL                                         $34     
         57        SEND_VAR                                                 $34
         58        DO_ICALL                                                 
   15    59        ASSIGN                                                   !4, 1
   16    60        ASSIGN                                                   !5, 1
   17    61        ASSIGN                                                   !6, 1
   19    62        SL                                               ~39     !1, 22
         63        BW_OR                                            ~40     ~39, -9223372036854775808
         64        SL                                               ~41     !4, 17
         65        BW_OR                                            ~42     ~40, ~41
         66        SL                                               ~43     !5, 12
         67        BW_OR                                            ~44     ~42, ~43
         68        BW_OR                                            ~45     !6, ~44
         69        ASSIGN                                                   !7, ~45
   20    70        SL                                               ~47     !2, 22
         71        BW_OR                                            ~48     ~47, -9223372036854775808
         72        SL                                               ~49     !4, 17
         73        BW_OR                                            ~50     ~48, ~49
         74        SL                                               ~51     !5, 12
         75        BW_OR                                            ~52     ~50, ~51
         76        BW_OR                                            ~53     !6, ~52
         77        ASSIGN                                                   !8, ~53
   21    78        SL                                               ~55     !3, 22
         79        BW_OR                                            ~56     ~55, -9223372036854775808
         80        SL                                               ~57     !4, 17
         81        BW_OR                                            ~58     ~56, ~57
         82        SL                                               ~59     !5, 12
         83        BW_OR                                            ~60     ~58, ~59
         84        BW_OR                                            ~61     !6, ~60
         85        ASSIGN                                                   !9, ~61
   23    86        INIT_FCALL                                               'var_dump'
         87        INIT_FCALL                                               'sprintf'
         88        SEND_VAL                                                 '%25b'
         89        SEND_VAR                                                 !7
         90        DO_ICALL                                         $63     
         91        SEND_VAR                                                 $63
         92        DO_ICALL                                                 
   24    93        INIT_FCALL                                               'var_dump'
         94        INIT_FCALL                                               'sprintf'
         95        SEND_VAL                                                 '%25b'
         96        SEND_VAR                                                 !8
         97        DO_ICALL                                         $65     
         98        SEND_VAR                                                 $65
         99        DO_ICALL                                                 
   25   100        INIT_FCALL                                               'var_dump'
        101        INIT_FCALL                                               'sprintf'
        102        SEND_VAL                                                 '%25b'
        103        SEND_VAR                                                 !9
        104        DO_ICALL                                         $67     
        105        SEND_VAR                                                 $67
        106        DO_ICALL                                                 
   37   107        INIT_FCALL                                               'bin2base64'
        108        SEND_VAR                                                 !7
        109        DO_FCALL                                      0  $69     
        110        ASSIGN                                                   !7, $69
   38   111        INIT_FCALL                                               'bin2base64'
        112        SEND_VAR                                                 !8
        113        DO_FCALL                                      0  $71     
        114        ASSIGN                                                   !8, $71
   39   115        INIT_FCALL                                               'bin2base64'
        116        SEND_VAR                                                 !9
        117        DO_FCALL                                      0  $73     
        118        ASSIGN                                                   !9, $73
   41   119        INIT_FCALL                                               'var_dump'
        120        SEND_VAR                                                 !7
        121        DO_ICALL                                                 
   42   122        INIT_FCALL                                               'var_dump'
        123        SEND_VAR                                                 !8
        124        DO_ICALL                                                 
   43   125        INIT_FCALL                                               'var_dump'
        126        SEND_VAR                                                 !9
        127        DO_ICALL                                                 
        128      > RETURN                                                   1

Function bin2base64:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/etJkB
function name:  bin2base64
number of ops:  21
compiled vars:  !0 = $entier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        INIT_FCALL                                               'dechex'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   30     5        INIT_FCALL                                               'hex2bin'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
   31     9        INIT_FCALL                                               'base64_encode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !0, $5
   32    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 '%3D'
         15        SEND_VAL                                                 ''
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !0, $7
   34    19      > RETURN                                                   !0
   35    20*     > RETURN                                                   null

End of function bin2base64

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.62 ms | 1479 KiB | 26 Q