3v4l.org

run code in 300+ PHP versions simultaneously
<?php function build_order_no() { $pre = sprintf('%02d', $id / 14000000);// 每1400万的前缀 // 这里乘以 123456789 一是一看就知道是9位长度,二则是产生的数字比较乱便于隐蔽 $tempcode = sprintf('%09d', sin(($id % 14000000 + 1) / 10000000.0) * 123456789); $seq = '371482506';// 这里定义 0-8 九个数字用于打乱得到的code $code = ''; for ($i = 0; $i < 9; $i++) { $code .= $tempcode[ $seq[$i] ]; } return $pre.$code; } $i = 10; while($i) { $no = build_order_no(); $uniqid = uniqid(); var_dump("$no\n$uniqid\n"); // file_put_contents('test.log', "$no\n$uniqid\n", FILE_APPEND); --$i; } echo PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 2
Branch analysis from position: 17
Branch analysis from position: 2
filename:       /in/JT8jj
function name:  (null)
number of ops:  19
compiled vars:  !0 = $i, !1 = $no, !2 = $uniqid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 10
    8     1      > JMP                                                      ->16
    9     2    >   INIT_FCALL                                               'build_order_no'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   10     5        INIT_FCALL                                               'uniqid'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   12     8        INIT_FCALL                                               'var_dump'
          9        ROPE_INIT                                     4  ~9      !1
         10        ROPE_ADD                                      1  ~9      ~9, '%0A'
         11        ROPE_ADD                                      2  ~9      ~9, !2
         12        ROPE_END                                      3  ~8      ~9, '%0A'
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                                 
   13    15        PRE_DEC                                                  !0
    8    16    > > JMPNZ                                                    !0, ->2
   16    17    >   ECHO                                                     '%0A'
         18      > RETURN                                                   1

Function build_order_no:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JT8jj
function name:  build_order_no
number of ops:  7
compiled vars:  !0 = $pre, !1 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'sprintf'
          1        SEND_VAL                                                 '%2502d'
          2        DIV                                              ~2      !1, 14000000
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    5     6      > RETURN                                                   null

End of function build_order_no

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.38 ms | 1399 KiB | 20 Q