3v4l.org

run code in 300+ PHP versions simultaneously
<?php function build_order_no() { $pre = sprintf('%02d', $id / 14000000); $tempcode = sprintf('%09d', sin(($id % 14000000 + 1) / 10000000.0) * 123456789); $seq = '371482506'; $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/2l51I
function name:  (null)
number of ops:  19
compiled vars:  !0 = $i, !1 = $no, !2 = $uniqid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 10
   16     1      > JMP                                                      ->16
   17     2    >   INIT_FCALL                                               'build_order_no'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   18     5        INIT_FCALL                                               'uniqid'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
   20     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                                                 
   21    15        PRE_DEC                                                  !0
   16    16    > > JMPNZ                                                    !0, ->2
   24    17    >   ECHO                                                     '%0A'
         18      > RETURN                                                   1

Function build_order_no:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 22
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 22
Branch analysis from position: 28
Branch analysis from position: 22
filename:       /in/2l51I
function name:  build_order_no
number of ops:  31
compiled vars:  !0 = $pre, !1 = $id, !2 = $tempcode, !3 = $seq, !4 = $code, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'sprintf'
          1        SEND_VAL                                                 '%2502d'
          2        DIV                                              ~6      !1, 14000000
          3        SEND_VAL                                                 ~6
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !0, $7
    5     6        INIT_FCALL                                               'sprintf'
          7        SEND_VAL                                                 '%2509d'
          8        INIT_FCALL                                               'sin'
          9        MOD                                              ~9      !1, 14000000
         10        ADD                                              ~10     ~9, 1
         11        DIV                                              ~11     ~10, 1.0e+7
         12        SEND_VAL                                                 ~11
         13        DO_ICALL                                         $12     
         14        MUL                                              ~13     $12, 123456789
         15        SEND_VAL                                                 ~13
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !2, $14
    6    18        ASSIGN                                                   !3, '371482506'
    7    19        ASSIGN                                                   !4, ''
    8    20        ASSIGN                                                   !5, 0
         21      > JMP                                                      ->26
   10    22    >   FETCH_DIM_R                                      ~19     !3, !5
         23        FETCH_DIM_R                                      ~20     !2, ~19
         24        ASSIGN_OP                                     8          !4, ~20
    8    25        PRE_INC                                                  !5
         26    >   IS_SMALLER                                               !5, 9
         27      > JMPNZ                                                    ~23, ->22
   12    28    >   CONCAT                                           ~24     !0, !4
         29      > RETURN                                                   ~24
   13    30*     > RETURN                                                   null

End of function build_order_no

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.31 ms | 1394 KiB | 22 Q