3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Tasodifiy kod generatsiya qiluvchi funksiya function generateFormattedCode() { // Harflar va raqamlar to'plami $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); // Format: CUBE-XXX-XXXX-XXXX-XXX $formattedCode = 'CUBE-'; // 3 ta belgini generatsiya qilish for ($i = 0; $i < 3; $i++) { $formattedCode .= $characters[rand(0, $charactersLength - 1)]; } $formattedCode .= '-'; // 4 ta belgini generatsiya qilish for ($i = 0; $i < 4; $i++) { $formattedCode .= $characters[rand(0, $charactersLength - 1)]; } $formattedCode .= '-'; // Yana 4 ta belgini generatsiya qilish for ($i = 0; $i < 4; $i++) { $formattedCode .= $characters[rand(0, $charactersLength - 1)]; } $formattedCode .= '-'; // Oxirgi 3 ta belgini generatsiya qilish for ($i = 0; $i < 3; $i++) { $formattedCode .= $characters[rand(0, $charactersLength - 1)]; } return $formattedCode; } // Bir necha o'yin kodi generatsiya qilish function generateMultipleCodes($count) { $codes = []; // $count miqdorida kod yaratish for ($i = 0; $i < $count; $i++) { $codes[] = generateFormattedCode(); } return $codes; } // 10 ta kod generatsiya qilish $gameCodes = generateMultipleCodes(10); // Natijani ko'rsatish foreach ($gameCodes as $code) { echo $code . PHP_EOL; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/nrr4s
function name:  (null)
number of ops:  11
compiled vars:  !0 = $gameCodes, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   INIT_FCALL                                               'generatemultiplecodes'
          1        SEND_VAL                                                 10
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   56     4      > FE_RESET_R                                       $4      !0, ->9
          5    > > FE_FETCH_R                                               $4, !1, ->9
   57     6    >   CONCAT                                           ~5      !1, '%0A'
          7        ECHO                                                     ~5
   56     8      > JMP                                                      ->5
          9    >   FE_FREE                                                  $4
   59    10      > RETURN                                                   1

Function generateformattedcode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 19
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 32
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 45
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 45
Branch analysis from position: 55
Branch analysis from position: 45
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 32
Branch analysis from position: 42
Branch analysis from position: 32
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 19
Branch analysis from position: 29
Branch analysis from position: 19
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/nrr4s
function name:  generateFormattedCode
number of ops:  57
compiled vars:  !0 = $characters, !1 = $charactersLength, !2 = $formattedCode, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    6     1        STRLEN                                           ~5      !0
          2        ASSIGN                                                   !1, ~5
    9     3        ASSIGN                                                   !2, 'CUBE-'
   12     4        ASSIGN                                                   !3, 0
          5      > JMP                                                      ->14
   13     6    >   INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 0
          8        SUB                                              ~9      !1, 1
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $10     
         11        FETCH_DIM_R                                      ~11     !0, $10
         12        ASSIGN_OP                                     8          !2, ~11
   12    13        PRE_INC                                                  !3
         14    >   IS_SMALLER                                               !3, 3
         15      > JMPNZ                                                    ~14, ->6
   16    16    >   ASSIGN_OP                                     8          !2, '-'
   19    17        ASSIGN                                                   !3, 0
         18      > JMP                                                      ->27
   20    19    >   INIT_FCALL                                               'rand'
         20        SEND_VAL                                                 0
         21        SUB                                              ~17     !1, 1
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                         $18     
         24        FETCH_DIM_R                                      ~19     !0, $18
         25        ASSIGN_OP                                     8          !2, ~19
   19    26        PRE_INC                                                  !3
         27    >   IS_SMALLER                                               !3, 4
         28      > JMPNZ                                                    ~22, ->19
   23    29    >   ASSIGN_OP                                     8          !2, '-'
   26    30        ASSIGN                                                   !3, 0
         31      > JMP                                                      ->40
   27    32    >   INIT_FCALL                                               'rand'
         33        SEND_VAL                                                 0
         34        SUB                                              ~25     !1, 1
         35        SEND_VAL                                                 ~25
         36        DO_ICALL                                         $26     
         37        FETCH_DIM_R                                      ~27     !0, $26
         38        ASSIGN_OP                                     8          !2, ~27
   26    39        PRE_INC                                                  !3
         40    >   IS_SMALLER                                               !3, 4
         41      > JMPNZ                                                    ~30, ->32
   30    42    >   ASSIGN_OP                                     8          !2, '-'
   33    43        ASSIGN                                                   !3, 0
         44      > JMP                                                      ->53
   34    45    >   INIT_FCALL                                               'rand'
         46        SEND_VAL                                                 0
         47        SUB                                              ~33     !1, 1
         48        SEND_VAL                                                 ~33
         49        DO_ICALL                                         $34     
         50        FETCH_DIM_R                                      ~35     !0, $34
         51        ASSIGN_OP                                     8          !2, ~35
   33    52        PRE_INC                                                  !3
         53    >   IS_SMALLER                                               !3, 3
         54      > JMPNZ                                                    ~38, ->45
   37    55    > > RETURN                                                   !2
   38    56*     > RETURN                                                   null

End of function generateformattedcode

Function generatemultiplecodes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Branch analysis from position: 4
filename:       /in/nrr4s
function name:  generateMultipleCodes
number of ops:  13
compiled vars:  !0 = $count, !1 = $codes, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
   42     1        ASSIGN                                                   !1, <array>
   45     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->9
   46     4    >   INIT_FCALL                                               'generateformattedcode'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  $6
   45     8        PRE_INC                                                  !2
          9    >   IS_SMALLER                                               !2, !0
         10      > JMPNZ                                                    ~8, ->4
   49    11    > > RETURN                                                   !1
   50    12*     > RETURN                                                   null

End of function generatemultiplecodes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.58 ms | 1456 KiB | 16 Q