3v4l.org

run code in 500+ PHP versions simultaneously
<?php function build_order_no() { mt_srand((double) microtime() * 1000000); return date('Ymd') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT); } $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/BBQ6m
function name:  (null)
number of ops:  19
compiled vars:  !0 = $i, !1 = $no, !2 = $uniqid
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                       !0, 10
   10     1      > JMP                                                          ->16
   11     2    >   INIT_FCALL                                                   'build_order_no'
          3        DO_FCALL                                          0  $4      
          4        ASSIGN                                                       !1, $4
   12     5        INIT_FCALL                                                   'uniqid'
          6        DO_ICALL                                             $6      
          7        ASSIGN                                                       !2, $6
   14     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                                                     
   15    15        PRE_DEC                                                      !0
   10    16    > > JMPNZ                                                        !0, ->2
   18    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/BBQ6m
function name:  build_order_no
number of ops:  23
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                                   'mt_srand'
          1        INIT_FCALL                                                   'microtime'
          2        DO_ICALL                                             $0      
          3        CAST                                              5  ~1      $0
          4        MUL                                                  ~2      ~1, 1000000
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                                     
    6     7        INIT_FCALL                                                   'date'
          8        SEND_VAL                                                     'Ymd'
          9        DO_ICALL                                             $4      
         10        INIT_FCALL                                                   'str_pad'
         11        INIT_FCALL                                                   'mt_rand'
         12        SEND_VAL                                                     1
         13        SEND_VAL                                                     99999
         14        DO_ICALL                                             $5      
         15        SEND_VAR                                                     $5
         16        SEND_VAL                                                     5
         17        SEND_VAL                                                     '0'
         18        SEND_VAL                                                     0
         19        DO_ICALL                                             $6      
         20        CONCAT                                               ~7      $4, $6
         21      > RETURN                                                       ~7
    7    22*     > RETURN                                                       null

End of function build_order_no

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
182.09 ms | 2586 KiB | 21 Q